CN117150112A - Push message generation method, device, equipment and storage medium based on redis - Google Patents

Push message generation method, device, equipment and storage medium based on redis Download PDF

Info

Publication number
CN117150112A
CN117150112A CN202310612830.9A CN202310612830A CN117150112A CN 117150112 A CN117150112 A CN 117150112A CN 202310612830 A CN202310612830 A CN 202310612830A CN 117150112 A CN117150112 A CN 117150112A
Authority
CN
China
Prior art keywords
message
data
subscription data
push
interactive object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310612830.9A
Other languages
Chinese (zh)
Inventor
谭珂
卜晓璇
石慧彪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202310612830.9A priority Critical patent/CN117150112A/en
Publication of CN117150112A publication Critical patent/CN117150112A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a push message generation method, a push message generation device, computer equipment and a storage medium based on redis. The method comprises the following steps: acquiring interaction data, and determining an interaction object triggering generation of the interaction data; inquiring subscription data of a message pushing service on the interactive object based on redis to obtain a first inquiry result; under the condition that the first query result is the subscription data of the message pushing service of the interactive object which is not queried, querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result; and generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is effective subscription data. The method can be applied to the field of big data, and the risk of database collapse can be reduced by adopting the method.

Description

Push message generation method, device, equipment and storage medium based on redis
Technical Field
The present application relates to the field of big data, and in particular, to a method, an apparatus, a device, and a storage medium for generating a push message based on redis.
Background
Along with the increase of population, the number of cards held by users is also rapidly increased, so that the traditional single scene that only one bank card is held by the users is not needed, and the delay of message pushing is greatly improved and the user experience is reduced under the concurrent transaction scene of double eleven and annual end.
The existing user message pushing function is strongly dependent on real-time access database to inquire the subscription state of a user, and under a high concurrency scene, the problem of database collapse can occur when the database is frequently accessed.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a redis-based push message generation method, apparatus, computer device, and computer-readable storage medium that can reduce the risk of database crashes.
In a first aspect, the present application provides a push message generation method based on redis, where the method includes:
acquiring interaction data, and determining an interaction object triggering generation of the interaction data;
inquiring subscription data of the message pushing service based on the redis to obtain a first inquiry result; the subscription data stored in the redis is part of data screened from the message push service subscription data stored in the database;
Under the condition that the first query result is that the subscription data of the message pushing service of the interactive object is not queried, querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result;
and generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is valid subscription data.
In one embodiment, the method further comprises:
acquiring a field to which each message push service subscription data belongs in a history inquiry task;
determining at least one of the fields as a target field based on the meaning of each of the fields and the update frequency of the data contained in each of the fields;
synchronizing the data contained in the target field in the database to the redis.
In one embodiment, the method further comprises:
based on message pushing service subscription data of each interactive object in the historical query task and pushing information pushed to the interactive object, establishing a mapping relation between the interactive object and the pushing information;
And according to the mapping relation, synchronizing the data representing the message content which is allowed to be pushed by the interactive object in the database to the redis.
In one embodiment, the method further comprises:
acquiring the proportion of effective message pushing service subscription data and invalid message pushing service subscription data in the historical query task in the database;
synchronizing the effective message push service subscription data to the redis when the proportion of the effective message push service subscription data is greater than the proportion of the invalid message push service subscription data;
and synchronizing the effective message pushing service subscription data and the invalid message pushing service subscription data to the redis when the proportion of the effective message pushing service subscription data is smaller than the proportion of the invalid message pushing service subscription data.
In one embodiment, the generating, based on the interaction data, a push message to be pushed to the interaction object includes:
generating push content based on the interaction data, and determining a message template of a current push message;
and filling the push content into the message template to obtain a push message to be pushed to the interactive object.
In one embodiment, the generating, based on the interaction data, a push message to be pushed to the interaction object includes:
acquiring an application scene of a current push message;
and performing at least one of splicing processing or screening processing on the fields of the interaction data based on the application scene to obtain a push message to be pushed to the interaction object.
In a second aspect, the present application provides a redis-based push message generating apparatus, where the apparatus includes:
the interactive object determining module is used for acquiring interactive data and determining an interactive object which triggers the generation of the interactive data;
the first query module is used for querying the subscription data of the message pushing service on the interactive object based on redis to obtain a first query result; the subscription data stored in the redis is part of data screened from the message push service subscription data stored in the database;
the second query module is used for querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result when the first query result is that the subscription data of the message pushing service of the interactive object is not queried;
And the message generating module is used for generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is valid subscription data.
In a third aspect, the present application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method described above.
In a fifth aspect, the application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method described above.
According to the redis-based push message generation method, device, equipment and storage medium, the interactive object capable of pushing the message can be accurately positioned by inquiring the subscription data of the interactive object triggering the generation of the interactive data; by firstly inquiring the message pushing service subscription data of the interactive object from the redis, then inquiring the message pushing service subscription data of the interactive object from the database under the condition that the redis does not exist the message pushing service subscription data of the interactive object, and generating pushing messages pushed to the interactive object under the condition that the subscription data of the message pushing service of the interactive object is inquired and the subscription data is effective data, the access times of the database can be reduced, the pressure of the database is reduced, the risk of database breakdown is reduced, and the pushing of the messages is realized.
Drawings
FIG. 1 is an application environment diagram of a redis-based push message generation method in one embodiment;
FIG. 2 is a flow diagram of a method for generating a redis-based push message in one embodiment;
FIG. 3 is a flowchart of a push message generation method based on redis according to another embodiment;
FIG. 4 is a block diagram of a push message generation device based on redis in one embodiment;
fig. 5 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The push message generation method based on redis provided by the embodiment of the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The server 104 first obtains the interaction data and then determines, based on the obtained interaction data, the interaction object that triggered the generation of the interaction data. The server 104 queries the message push service subscription data of the interactive object in the redis to obtain a first query result. And when the server detects that the message pushing service subscription data of the interactive object does not exist in the redis, inquiring the message pushing service subscription data of the interactive object from the database to obtain a second inquiry result. When the second query result is the message pushing service subscription data of the queried interactive object and the message pushing service subscription data is the valid subscription data, the server 104 generates a pushing message to be pushed to the interactive object according to the subscription data of the interactive object. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, tablet computers, etc. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a push message generating method based on redis is provided, and the method is applied to the server 104 in fig. 1 for illustration, and includes the following steps:
step 202, obtaining interaction data, and determining an interaction object triggering to generate the interaction data.
The interactive data refers to data generated after the interactive object interacts with the server. For example, a customer may generate transaction data after purchasing an item on a network, the transaction data being interaction data, the customer representing an interaction object. The acquired interaction data is derived from at least one interaction object. The acquisition sources of the interaction data include databases of stores of items purchased by customers, and the like. The interactive object can trigger message pushing every time one stroke of data is generated, and meanwhile, one stroke of interactive data can trigger various message pushing.
Optionally, after the server acquires the interaction data, the server determines the interaction object triggering to generate the interaction data based on the whole generation process of the interaction data.
Step 204, performing subscription data query of the message pushing service on the interactive object based on redis to obtain a first query result. The subscription data stored in redis is part of data screened from the message push service subscription data stored in the database.
Wherein, redis is an open source written using ANSI C (American National Standard Institite C, standard issued by american national standards institute for C language), comprising a plurality of data structures, supporting network, memory-based, optionally persistent key-value pair storage databases, which has the following characteristics: based on memory operation, the performance is high; support the distributed type, can be expanded infinitely theoretically; a key value storage system; open source is written in ANSI C language, complies with BSD (Berkeley Software Distribution license, licensing protocol), supports networking, can be memory-based or persistent log-type, key-value data databases, and provides API (Application Programming Interface ) in multiple languages.
The inquiry of subscription data is mainly based on the design of the whole message pushing function by business, and besides inquiring by the information of client number, card number and the like, part of the scenes also relate to inquiring whether the occurrence time of the transaction accords with the time interval designed by the user according to whether the user sets the threshold value of money reminding or not.
The subscription data of the message pushing service refers to the data of the message pushing aspect signed by the interactive object, and can be used for representing the subscription state of the interactive object. The subscription data of the effective message pushing service indicates that the subscription data is still in a subscription state, and message pushing can be performed on the interactive object corresponding to the subscription data of the message pushing service. The invalid subscription data of the message pushing service indicates that the subscription of the interactive object is invalid or not validated, and message pushing cannot be performed on the interactive object corresponding to the subscription data of the message pushing service. Each time a subscription data change is synchronized from the database to the dis. The change of the subscription data refers to the addition of new sign-up clients, the resolution of old client subscription information or modification information.
The first query result comprises message pushing service subscription data of the interactive object queried in the redis and message pushing service subscription data of the interactive object not queried.
Optionally, the server queries the message pushing service subscription data of the interactive object generating the interactive data in the redis, so as to obtain a first query result. Before inquiring in redis, the server screens partial data from the message push service subscription data in the database and stores the partial data in redis.
Step 206, in the case that the first query result is that the subscription data of the message pushing service of the interactive object is not queried, querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result.
The second query result comprises message pushing service subscription data of the interactive object queried in the database and message pushing service subscription data of the interactive object not queried.
Optionally, when the server does not query the message pushing service subscription data of the interactive object in the redis, query the message pushing service subscription data of the interactive object from the database, thereby obtaining a second query result.
Step 207, generating a push message to be pushed to the interactive object based on the interactive data when the first query result is the message push service subscription data of the queried interactive object and the queried message push service subscription data is the valid subscription data.
Step 208, generating a push message to be pushed to the interactive object based on the interactive data when the second query result is the message push service subscription data of the queried interactive object and the queried message push service subscription data is the valid subscription data.
The push message may be determined based on the interaction data generated by the interaction object trigger and the application scene of the current push message, and may also be determined based on the interaction data of the interaction object and the message template of the current push message.
Optionally, when the server detects that the first query result is message pushing service subscription data of the queried interactive object and the queried message pushing service subscription data of the interactive object is valid subscription data, generating a pushing message to be pushed to the interactive object according to the interactive data of the interactive object and a message template of the current pushing message.
Optionally, when the server detects that the first query result is the message pushing service subscription data of the non-queried interactive object and the second query result is the message pushing service subscription data of the queried interactive object, and the queried message pushing service subscription data of the interactive object is valid subscription data, generating a pushing message to be pushed to the interactive object according to the interactive data of the interactive object and a message template of the current pushing message.
Optionally, when the server detects that the first query result is message pushing service subscription data of the queried interactive object and the queried message pushing service subscription data of the interactive object is valid subscription data, generating a pushing message to be pushed to the interactive object according to the interactive data of the interactive object and an application scene of the current pushing message.
Optionally, when the server detects that the first query result is the message pushing service subscription data of the non-queried interactive object and the second query result is the message pushing service subscription data of the queried interactive object, and the queried message pushing service subscription data of the interactive object is valid subscription data, generating a pushing message to be pushed to the interactive object according to the interactive data of the interactive object and an application scene of the current pushing message.
In the push message generation method based on redis, the interactive object triggering the generation of the interactive data is queried for subscription data, so that the interactive object capable of pushing the message can be accurately positioned; by firstly inquiring the message pushing service subscription data of the interactive object from the redis, then inquiring the message pushing service subscription data of the interactive object from the database under the condition that the redis does not exist the message pushing service subscription data of the interactive object, and generating pushing messages pushed to the interactive object under the condition that the subscription data of the message pushing service of the interactive object is inquired and the subscription data is effective data, the access times of the database can be reduced, the pressure of the database is reduced, the risk of database breakdown is reduced, and the pushing of the messages is realized.
In one embodiment, the redis-based push message generation method further includes:
and acquiring the field of the subscription data of each message push service in the history inquiry task.
At least one of the fields is determined as a target field based on the meaning of each field and the update frequency of the data contained in each field.
And synchronizing the target field in the database and the data contained in the target field to redis.
The historical query task refers to a task for querying subscription data of a historical message pushing service when the message pushing is performed in the past.
The fields may be understood as rows or columns in a database table, e.g., name, subscription time, subscription expiration date, subscription service, etc. The update frequency of data refers to the frequency at which each data in the database fluctuates. The reasons for the change of the data mainly comprise active modification of the interactive object and modification of the server side according to the actual situation. For example, if the interactive object modifies the telephone number in the subscription data of the message push service a plurality of times, the modified telephone number is characterized as data allowing synchronization from the database to redis. The target field may also be a field that is understood to be a field that may be used for a query. Such as a name, with obvious query terms.
The data contained in the field refers to each piece of data under the field. For example, the name field contains data of name 1, name 2, name 3, and the like.
Optionally, the server analyzes the meaning of the field to which the subscription data of each message push service queried in the historical query task belongs, and synchronizes the target field with the query function and the data contained in the target field from the database to the redis.
Optionally, the server acquires the field of each message push service subscription data queried in the history query task, determines the update frequency of the data contained in the field, determines the field of the data subjected to multiple modification as a target field, and synchronizes the modified data and the target field of the modified data from the database to the redis.
In this embodiment, by determining the target field that is allowed to synchronize to redis according to the meaning of the field involved in the historical query task and the update frequency of the data contained in the field, and synchronizing the target field, that is, the data contained in the target field, to redis, the data and the field queried for multiple times in the database can be synchronized to redis, so that when the data is queried next time, the data can be queried only by accessing redis, thereby reducing the access times of the database and reducing the crash risk of the database.
In one embodiment, the redis-based push message generation method further includes:
and establishing a mapping relation between the interactive objects and the push messages based on the message push service subscription data of each interactive object in the historical query task and the push messages pushed to the interactive objects.
According to the mapping relation, synchronizing the data representing the message content which the interactive object allows to push in the database to the redis.
Wherein the mapping relation is used for representing the message that the interactive object is allowed to be pushed. For example, according to the message pushing service subscription data of the interactive object a and the message pushed to the interactive object a in the past, it can be found that the subscription data of the interactive object a is effective, but the message pushed by the interactive object a in the past is mostly a message of a greeting type or a product introduction type, so that a conclusion can be obtained, when the message is pushed next time, if the message is a greeting type or a product introduction type, the interactive object a can be set as a candidate pushing object, and if the message is not a greeting type or a product introduction type, the subscription data of the interactive object a is in an effective state, and the message pushing is not performed on the interactive object a. When the data in the database is synchronized into the redis, the data which is allowed to be synchronized into the redis in the database is synchronized into the redis at daily timing, so that the state of the data in the redis is ensured to be consistent with the state of the data stored in the database.
Optionally, the server establishes a mapping relation between messages representing each interactive object to be pushed according to the message pushing service subscription data of each interactive object queried in the history query task and the history pushing messages pushed to the interactive objects. And the server synchronizes the data representing the message of which the interactive object is allowed to be pushed into the redis according to the mapping relation of the message of which the interactive object is allowed to be pushed.
In this embodiment, through the mapping relationship established according to the message pushing service subscription data of each interactive object queried in the history query task and the history pushing message pushed to the interactive object, the data representing the message content allowed to be pushed by the interactive object in the database can be synchronized into redis, so that when the data is needed to be queried next time, the data can be queried only by accessing redis, thereby reducing the access times of the database and reducing the crash risk of the database.
In one embodiment, the redis-based push message generation method further includes:
and acquiring the proportion of the effective message pushing service subscription data and the invalid message pushing service subscription data in the historical query task in the database.
And synchronizing the effective message push service subscription data to redis when the proportion of the effective message push service subscription data is greater than the proportion of the invalid message push service subscription data.
And synchronizing the valid message pushing service subscription data and the invalid message pushing service subscription data to redis when the proportion of the valid message pushing service subscription data is smaller than the proportion of the invalid message pushing service subscription data.
Wherein, the valid message push service subscription data refers to that the subscription data is already in effect. The failed message push service subscription data refers to that the subscription data has failed or has not been validated, and the failed message push service subscription data can also be used to characterize that the interactive object is not subscribed. For example, each service message pushing service corresponds to one subscription table in the database, if valid subscription data in the table is hit in a large amount during query, invalid subscription data is less than 20%, only 80% of signed and valid data is stored, and if the hit proportion of the invalid subscription data is higher than that of the valid subscription data, all data in the database needs to be stored to redis.
Optionally, the server queries the proportion of the invalid message push service subscription data and the valid message push service subscription data in the database according to the history. When the server detects that the proportion of the invalid message pushing service subscription data is larger than that of the valid message pushing service subscription data, the invalid message pushing service subscription data and the valid message pushing service subscription data in the database are synchronized into redis.
Optionally, the server queries the proportion of the invalid message push service subscription data and the valid message push service subscription data in the database according to the history. When the server detects that the proportion of the invalid message pushing service subscription data is smaller than or equal to that of the valid message pushing service subscription data, the valid message pushing service subscription data in the database is synchronized to redis.
In this embodiment, by querying the proportion of the invalid message push service subscription data and the valid message push service subscription data in the database according to the historical query task, part of the data in the database can be synchronized to the redis according to the proportion result, so that the data can be queried only by accessing the redis when the data is required to be queried next time, thereby reducing the access times of the database and reducing the collapse risk of the database.
In one embodiment, as shown in fig. 3, generating a push message to be pushed to an interactive object based on interactive data includes:
step 301, when the first query result is the message pushing service subscription data of the queried interactive object and the queried message pushing service subscription data is the valid subscription data, generating pushing content based on the interactive data, and determining a message template of the current pushing message.
Wherein generating push content based on the interaction data includes determining a hobby of the interaction object based on the interaction data, generating push content matching the hobby of the interaction object. And generating the preferential information push content of the mechanism connected with the data source according to the source of the acquired interaction data. For example, the interaction data a is obtained from the website X, and then the mechanism providing the data interaction interface for the website X is a mechanism connected with the data source, and based on the generated interaction data and the preferential information provided by the mechanism, preferential message pushing content of the mechanism can be generated.
Message templates refer to a fixed template format. For example, after the user consumes the amount in the bank card, the bank may push the consumed amount and the remaining balance to the user according to a fixed template.
Step 302, when the second query result is the message pushing service subscription data of the queried interactive object and the queried message pushing service subscription data is the valid subscription data, generating pushing content based on the interactive data, and determining a message template of the current pushing message.
Step 304, the push content is filled into the message template, and a push message to be pushed to the interactive object is obtained.
The push message to be pushed to the interactive object is loaded to the target system, and the target system pushes the push message to the interactive object finally. The target system includes a short message management platform, such as a banking application. When the last message pushing is carried out, the user signs up for a certain service, and the data of the transaction meets the requirement of service evaluation, so that the message pushing can be carried out. The target system will conduct business assessment on the data of the transaction.
Optionally, the server fills the push content obtained based on the interaction data into the template according to the format of the message template, thereby obtaining the push message to be pushed to the interaction object.
In one specific application, the server determines specific transaction information, namely, specific consumption amount and residual amount of the bank card, from the transaction data according to transaction data triggered when the user uses the bank card to consume, thereby obtaining generated content. And the server fills the consumed monetary amount and the residual monetary amount into a message template of a consumption reminding class, so that a push message to be pushed to the interactive object can be obtained.
In this embodiment, processing of the interactive data can be completed by generating push content according to the interactive data, and then, concise and clear push information pushed to the interactive object can be obtained by filling the push content into the message template, so that the push cost is reduced, and the purpose of reducing the user anti-sensitivity is achieved.
In one embodiment, generating a push message to be pushed to an interactive object based on interactive data includes:
and acquiring an application scene of the current push message.
And performing at least one of splicing processing or screening processing on the fields of the interaction data based on the application scene to obtain the push message to be pushed to the interaction object.
The application scene of the current push message mainly comprises a greeting scene, a preferential introduction scene, a balance reminding scene and the like.
The splicing process or the screening process refers to field splicing or field screening of the same transaction data. Some target systems require but the data source is not a field for interaction data, default filling is performed.
Optionally, the server acquires an application scene used by the current push message, and then performs field splicing processing on the interactive data of the interactive object according to the used application scene, so as to obtain the push message to be pushed to the interactive object.
Optionally, the server acquires an application scene used by the current push message, and then performs field screening processing on the interaction data of the interaction object according to the used application scene, so as to obtain the push message to be pushed to the interaction object.
Optionally, the server acquires an application scene used by the current push message, and then performs field splicing and field screening processing on the interactive data of the interactive object according to the used application scene, so as to obtain the push message to be pushed to the interactive object.
In this embodiment, at least one of splicing and screening the fields of the interaction data is performed according to the application scenario pair of the current push message, so that concise and clear push information pushed to the interaction object can be obtained, invalid push cost is reduced, and user anti-sensitivity is reduced.
The application also provides an application scene, which applies the push message generation method based on redis. Specifically, the application of the redis-based push message generation method in the application scene is as follows: after the interactive object generates a transaction, the server obtains the full amount of transaction data from each channel. The server inquires the message pushing service subscription data of the interactive object generating the interactive data in the redis, so as to obtain a first inquiry result. When the first query result shows that the message pushing service subscription data of the interactive object is not queried, then querying the message pushing service subscription data of the interactive object from the database to obtain a second query result, and when the second query result shows that the message pushing service subscription data of the interactive object is queried and the queried message pushing service subscription data of the interactive object is valid subscription data, generating a pushing message to be pushed to the interactive object according to the interactive data of the interactive object and the message template of the current pushing message.
The server determines the proportion of invalid message pushing service subscription data and effective message pushing service subscription data which are queried in the historical query task in the database from the database synchronization part data to the redis. When the server detects that the proportion of the invalid message pushing service subscription data is smaller than or equal to that of the valid message pushing service subscription data, the valid message pushing service subscription data in the database is synchronized to the redis, and if the queried message pushing service subscription data is in the redis, the database does not need to be accessed.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a redis-based push message generation device for realizing the redis-based push message generation method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the redis-based push message generating device or devices provided below may be referred to the limitation of the redis-based push message generating method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 4, there is provided a push message generating device based on redis, including:
the interactive object determining module 402 is configured to obtain interactive data, and determine an interactive object that triggers generation of the interactive data.
The first query module 404 is configured to query subscription data of the message pushing service for the interactive object based on redis, so as to obtain a first query result. The subscription data stored in redis is part of data screened from the message push service subscription data stored in the database.
And the second query module 406 is configured to query the subscription data of the message pushing service for the interactive object based on the database to obtain a second query result when the first query result is that the subscription data of the message pushing service for the interactive object is not queried.
The message generating module 408 is configured to generate, based on the interaction data, a push message to be pushed to the interaction object, where the first query result or the second query result is message push service subscription data of the queried interaction object and the queried message push service subscription data is valid subscription data.
In some embodiments, the redis-based push message generating apparatus further includes:
the field acquisition unit is used for acquiring the field of the subscription data of each message push service in the history inquiry task.
And the target field determining unit is used for determining at least one field in the fields as a target field based on the meaning of each field and the updating frequency of the data contained in each field.
The first data synchronization unit is used for synchronizing the target field and the data contained in the target field in the database to the redis.
In some embodiments, the redis-based push message generating apparatus further includes:
and the mapping relation determining unit is used for establishing a mapping relation between the interactive objects and the push messages based on the message push service subscription data of each interactive object in the history inquiry task and the push messages pushed to the interactive objects.
And the second data synchronization unit is used for synchronizing the data representing the message content of which the interactive object is allowed to be pushed in the database to redis according to the mapping relation.
In some embodiments, the redis-based push message generating apparatus further includes:
the proportion determining unit is used for acquiring the proportion of the effective message pushing service subscription data and the invalid message pushing service subscription data in the historical query task in the database.
And the third data synchronization unit is used for synchronizing the effective message push service subscription data to redis when the proportion of the effective message push service subscription data is greater than that of the invalid message push service subscription data.
And the fourth data synchronization unit is used for synchronizing the valid message pushing service subscription data and the invalid message pushing service subscription data to redis when the proportion of the valid message pushing service subscription data is smaller than that of the invalid message pushing service subscription data.
In some embodiments, the message generation module comprises:
and the template determining unit is used for generating push content based on the interaction data and determining a message template of the current push message.
And the first message generating unit is used for filling the push content into the message template to obtain the push message to be pushed to the interaction object.
In some embodiments, the message generation module comprises:
the scene determining unit is used for acquiring the application scene of the current push message.
And the second message generating unit is used for performing at least one of splicing processing or screening processing on the fields of the interaction data based on the application scene to obtain the push message to be pushed to the interaction object.
The above-described modules in the redis-based push message generation apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing interactive data, interactive objects, subscription data stored in a first query result and a redis, a second query result, push messages, fields of each message push service subscription data in a history query task, meanings of each field, update frequency of data contained in each field, target fields, mapping relations, proportion of the effective message push service subscription data and invalid message push service subscription data in the database, message templates of current push messages, application scenes of the current push messages and field data of the interactive data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a redis-based push message generation method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 5 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring interaction data, and determining an interaction object triggering generation of the interaction data; inquiring subscription data of a message pushing service on the interactive object based on redis to obtain a first inquiry result; the subscription data stored in redis is part of data screened from message push service subscription data stored in a database; under the condition that the first query result is the subscription data of the message pushing service of the interactive object which is not queried, querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result; and generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is effective subscription data.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a field to which each message push service subscription data belongs in a history inquiry task; determining at least one of the fields as a target field based on the meaning of each field and the update frequency of the data contained in each field; and synchronizing the target field in the database and the data contained in the target field to redis.
In one embodiment, the processor when executing the computer program further performs the steps of:
based on message pushing service subscription data of each interactive object in the historical query task and pushing information pushed to the interactive object, establishing a mapping relation between the interactive object and the pushing information; according to the mapping relation, synchronizing the data representing the message content which the interactive object allows to push in the database to the redis.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring the proportion of effective message pushing service subscription data and invalid message pushing service subscription data in a historical query task in a database respectively; synchronizing the effective message push service subscription data to redis when the proportion of the effective message push service subscription data is greater than the proportion of the invalid message push service subscription data; and synchronizing the valid message pushing service subscription data and the invalid message pushing service subscription data to redis when the proportion of the valid message pushing service subscription data is smaller than the proportion of the invalid message pushing service subscription data.
In one embodiment, the processor when executing the computer program further performs the steps of:
generating push content based on the interaction data, and determining a message template of the current push message; and filling the push content into a message template to obtain a push message to be pushed to the interaction object.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring an application scene of a current push message; and performing at least one of splicing processing or screening processing on the fields of the interaction data based on the application scene to obtain the push message to be pushed to the interaction object.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring interaction data, and determining an interaction object triggering generation of the interaction data; inquiring subscription data of a message pushing service on the interactive object based on redis to obtain a first inquiry result; the subscription data stored in redis is part of data screened from message push service subscription data stored in a database; under the condition that the first query result is the subscription data of the message pushing service of the interactive object which is not queried, querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result; and generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is effective subscription data.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a field to which each message push service subscription data belongs in a history inquiry task; determining at least one of the fields as a target field based on the meaning of each field and the update frequency of the data contained in each field; and synchronizing the target field in the database and the data contained in the target field to redis.
In one embodiment, the processor when executing the computer program further performs the steps of:
based on message pushing service subscription data of each interactive object in the historical query task and pushing information pushed to the interactive object, establishing a mapping relation between the interactive object and the pushing information; according to the mapping relation, synchronizing the data representing the message content which the interactive object allows to push in the database to the redis.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring the proportion of effective message pushing service subscription data and invalid message pushing service subscription data in a historical query task in a database respectively; synchronizing the effective message push service subscription data to redis when the proportion of the effective message push service subscription data is greater than the proportion of the invalid message push service subscription data; and synchronizing the valid message pushing service subscription data and the invalid message pushing service subscription data to redis when the proportion of the valid message pushing service subscription data is smaller than the proportion of the invalid message pushing service subscription data.
In one embodiment, the processor when executing the computer program further performs the steps of:
generating push content based on the interaction data, and determining a message template of the current push message; and filling the push content into a message template to obtain a push message to be pushed to the interaction object.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring an application scene of a current push message; and performing at least one of splicing processing or screening processing on the fields of the interaction data based on the application scene to obtain the push message to be pushed to the interaction object.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
acquiring interaction data, and determining an interaction object triggering generation of the interaction data; inquiring subscription data of a message pushing service on the interactive object based on redis to obtain a first inquiry result; the subscription data stored in redis is part of data screened from message push service subscription data stored in a database; under the condition that the first query result is the subscription data of the message pushing service of the interactive object which is not queried, querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result; and generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is effective subscription data.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a field to which each message push service subscription data belongs in a history inquiry task; determining at least one of the fields as a target field based on the meaning of each field and the update frequency of the data contained in each field; and synchronizing the target field in the database and the data contained in the target field to redis.
In one embodiment, the processor when executing the computer program further performs the steps of:
based on message pushing service subscription data of each interactive object in the historical query task and pushing information pushed to the interactive object, establishing a mapping relation between the interactive object and the pushing information; according to the mapping relation, synchronizing the data representing the message content which the interactive object allows to push in the database to the redis.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring the proportion of effective message pushing service subscription data and invalid message pushing service subscription data in a historical query task in a database respectively; synchronizing the effective message push service subscription data to redis when the proportion of the effective message push service subscription data is greater than the proportion of the invalid message push service subscription data; and synchronizing the valid message pushing service subscription data and the invalid message pushing service subscription data to redis when the proportion of the valid message pushing service subscription data is smaller than the proportion of the invalid message pushing service subscription data.
In one embodiment, the processor when executing the computer program further performs the steps of:
generating push content based on the interaction data, and determining a message template of the current push message; and filling the push content into a message template to obtain a push message to be pushed to the interaction object.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring an application scene of a current push message; and performing at least one of splicing processing or screening processing on the fields of the interaction data based on the application scene to obtain the push message to be pushed to the interaction object.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A push message generation method based on redis, the method comprising:
acquiring interaction data, and determining an interaction object triggering generation of the interaction data;
inquiring subscription data of the message pushing service based on the redis to obtain a first inquiry result; the subscription data stored in the redis is part of data screened from the message push service subscription data stored in the database;
Under the condition that the first query result is that the subscription data of the message pushing service of the interactive object is not queried, querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result;
and generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is valid subscription data.
2. The method according to claim 1, wherein the method further comprises:
acquiring a field to which each message push service subscription data belongs in a history inquiry task;
determining at least one of the fields as a target field based on the meaning of each of the fields and the update frequency of the data contained in each of the fields;
synchronizing the data contained in the target field in the database to the redis.
3. The method according to claim 1, wherein the method further comprises:
based on message pushing service subscription data of each interactive object in the historical query task and pushing information pushed to the interactive object, establishing a mapping relation between the interactive object and the pushing information;
And according to the mapping relation, synchronizing the data representing the message content which is allowed to be pushed by the interactive object in the database to the redis.
4. The method according to claim 1, wherein the method further comprises:
acquiring the proportion of effective message pushing service subscription data and invalid message pushing service subscription data in the historical query task in the database;
synchronizing the effective message push service subscription data to the redis when the proportion of the effective message push service subscription data is greater than the proportion of the invalid message push service subscription data;
and synchronizing the effective message pushing service subscription data and the invalid message pushing service subscription data to the redis when the proportion of the effective message pushing service subscription data is smaller than the proportion of the invalid message pushing service subscription data.
5. The method of claim 1, wherein the generating a push message to be pushed to the interactive object based on the interactive data comprises:
generating push content based on the interaction data, and determining a message template of a current push message;
And filling the push content into the message template to obtain a push message to be pushed to the interactive object.
6. The method of claim 1, wherein the generating a push message to be pushed to the interactive object based on the interactive data comprises:
acquiring an application scene of a current push message;
and performing at least one of splicing processing or screening processing on the fields of the interaction data based on the application scene to obtain a push message to be pushed to the interaction object.
7. A redis-based push message generation apparatus, the apparatus comprising:
the interactive object determining module is used for acquiring interactive data and determining an interactive object which triggers the generation of the interactive data;
the first query module is used for querying the subscription data of the message pushing service on the interactive object based on redis to obtain a first query result; the subscription data stored in the redis is part of data screened from the message push service subscription data stored in the database;
the second query module is used for querying the subscription data of the message pushing service of the interactive object based on the database to obtain a second query result when the first query result is that the subscription data of the message pushing service of the interactive object is not queried;
And the message generating module is used for generating a push message to be pushed to the interactive object based on the interactive data under the condition that the first query result or the second query result is message push service subscription data of the queried interactive object and the queried message push service subscription data is valid subscription data.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202310612830.9A 2023-05-26 2023-05-26 Push message generation method, device, equipment and storage medium based on redis Pending CN117150112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310612830.9A CN117150112A (en) 2023-05-26 2023-05-26 Push message generation method, device, equipment and storage medium based on redis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310612830.9A CN117150112A (en) 2023-05-26 2023-05-26 Push message generation method, device, equipment and storage medium based on redis

Publications (1)

Publication Number Publication Date
CN117150112A true CN117150112A (en) 2023-12-01

Family

ID=88908799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310612830.9A Pending CN117150112A (en) 2023-05-26 2023-05-26 Push message generation method, device, equipment and storage medium based on redis

Country Status (1)

Country Link
CN (1) CN117150112A (en)

Similar Documents

Publication Publication Date Title
CN110647512B (en) Data storage and analysis method, device, equipment and readable medium
WO2020155771A1 (en) Spreadsheet data processing method and apparatus, computer device, and storage medium
US11947613B2 (en) System and method for efficiently querying data using temporal granularities
CN109299175B (en) Dynamic expansion method, system, device and storage medium for database
CN114565443B (en) Data processing method, data processing device, computer equipment and storage medium
CN116339626A (en) Data processing method, device, computer equipment and storage medium
CN117150112A (en) Push message generation method, device, equipment and storage medium based on redis
CN110765131A (en) Data compression method and device for goods source data, computer equipment and storage medium
US20210141791A1 (en) Method and system for generating a hybrid data model
CN113268483A (en) Request processing method and device, electronic equipment and storage medium
CN115544096B (en) Data query method and device, computer equipment and storage medium
CN109933573B (en) Database service updating method, device and system
CN111563091B (en) Method and system for batch updating MongoDB in non-round-trip mode
WO2022178931A1 (en) Implementation method, apparatus and device for querying dynamic columns
CN117130606A (en) Front-end page configuration method, front-end page configuration device, computer equipment and storage medium
CN114840593A (en) Service data processing method and device, computer equipment and storage medium
CN118115203A (en) Method, device and equipment for processing virtual asset and computer readable storage medium
CN117216164A (en) Financial data synchronous processing method, apparatus, device, medium and program product
CN113886383A (en) Data processing method, data processing apparatus, electronic device, storage medium, and program product
CN116048468A (en) Method, device, electronic equipment and medium for loading cache data and processing data
CN117131072A (en) Financial business query method, device, computer equipment and storage medium
CN114610688A (en) Log aggregation method and device, computer equipment and storage medium
CN117216359A (en) Method, device, computer equipment and storage medium for determining information push object
CN116756201A (en) Customer portrait analysis method, apparatus, device and readable storage medium
CN114780561A (en) Entity attribute editing method and device, computer equipment and storage medium

Legal Events

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