Message processing method and device, readable storage medium and electronic equipment

文档序号:1395784 发布日期:2020-02-28 浏览:8次 中文

阅读说明:本技术 消息处理方法、装置、可读存储介质及电子设备 (Message processing method and device, readable storage medium and electronic equipment ) 是由 李永超 薛茜 于 2019-11-05 设计创作,主要内容包括:本公开涉及一种消息处理方法、装置、可读存储介质及电子设备,所述方法包括:在接收针对目标账户的积分更新消息之后,确定是否能够根据所述积分更新消息对所述目标账户的积分信息进行更新;若确定不能根据所述积分更新消息对所述目标账户的积分信息进行更新,则在所述积分更新消息的等待时长超过时间阈值时,将所述积分更新消息存储至延时队列;确定所述积分更新消息从所述延时队列中移出的延时时间,以基于所述延时时间将所述积分更新消息从所述延时队列中移出;对移出后的所述积分更新消息进行处理。因此,可以有效避免过多的积分更新消息处于等待状态所造成的消息阻塞,保证消息处理的稳定性。同时,保证积分信息更新的实时性和准确性。(The disclosure relates to a message processing method, a device, a readable storage medium and an electronic device, wherein the method comprises the following steps: after receiving a point updating message for a target account, determining whether point information of the target account can be updated according to the point updating message; if the integral information of the target account cannot be updated according to the integral updating message is determined, storing the integral updating message to a delay queue when the waiting time of the integral updating message exceeds a time threshold; determining a delay time for the credit update message to be removed from the delay queue to remove the credit update message from the delay queue based on the delay time; and processing the shifted-out integral updating message. Therefore, message blocking caused by excessive integral updating messages in a waiting state can be effectively avoided, and the stability of message processing is ensured. Meanwhile, the real-time performance and accuracy of the updating of the integral information are guaranteed.)

1. A method of message processing, the method comprising:

after receiving a point updating message for a target account, determining whether point information of the target account can be updated according to the point updating message;

if the integral information of the target account cannot be updated according to the integral updating message is determined, storing the integral updating message to a delay queue when the waiting time of the integral updating message exceeds a time threshold;

determining a delay time for the credit update message to be removed from the delay queue to remove the credit update message from the delay queue based on the delay time;

and processing the shifted-out integral updating message.

2. The method of claim 1, wherein the delay time for the credit update message to be removed from the delay queue is determined by:

Td=Tbase+random()

wherein, TdFor representing the delay time;

Tbasethe device is used for representing a preset reference delay time;

random () represents a random function.

3. The method of claim 1, wherein after receiving a credit update message for a target account, prior to the step of determining whether credit information for the target account can be updated according to the credit update message, the method further comprises:

and determining whether the message identifier of the received point updating message is stored in a database, and if the message identifier is not stored in the database, executing the step of determining whether the point information of the target account can be updated according to the point updating message.

4. The method of claim 3, further comprising, after the step of processing the shifted out credit update message:

storing the message identification in the database.

5. The method of claim 4, further comprising:

determining the storage duration of the message identifier in the database, and deleting the message identifier from the database if the storage duration exceeds a first duration threshold;

or

And deleting the message identifier of which the time length from the current time to the storage time in the database is greater than a second time length threshold value at every preset time interval.

6. The method of claim 1, wherein the determining whether the point information of the target account can be updated according to the point update message comprises:

determining the state of an integration lock corresponding to the integration information, wherein the integration lock is used for controlling the updating of the integration information;

if the state of the integral lock is a locking state, determining that the integral information of the target account cannot be updated according to the integral updating message;

and if the state of the integral lock is an idle state, determining to update the integral information according to the integral update message.

7. The method of claim 1, further comprising:

acquiring a point information accumulated value of the target account in a target time period;

acquiring a point information change value corresponding to the target account recorded by the wallet system in the target time period;

if the absolute value of the difference value between the accumulated value of the integral information and the variation value of the integral information is smaller than an integral difference threshold value, keeping the integral information of the target account unchanged;

and if the absolute value of the difference value between the accumulated integral information value and the change value of the integral information is greater than or equal to the integral difference threshold value, determining an integral adjustment value according to the accumulated integral information value and the change value of the integral information, and adjusting the integral information of the target account according to the integral adjustment value.

8. A message processing apparatus, characterized in that the apparatus comprises:

the system comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining whether the point information of a target account can be updated according to a point updating message after the point updating message for the target account is received;

the first storage module is used for storing the point updating message to a delay queue when the waiting duration of the point updating message exceeds a time threshold under the condition that the point information of the target account cannot be updated according to the point updating message;

a second determining module, configured to determine a delay time for removing the credit update message from the delay queue, so as to remove the credit update message from the delay queue based on the delay time;

and the processing module is used for processing the shifted-out integral updating message.

9. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the steps of the method of any one of claims 1 to 7.

10. An electronic device, comprising:

a storage device having a computer program stored thereon;

processing means for executing the computer program in the storage means to carry out the steps of the method according to any one of claims 1 to 7.

Technical Field

The present disclosure relates to the field of message processing, and in particular, to a message processing method, a message processing apparatus, a readable storage medium, and an electronic device.

Background

With the development of network communication technology, live broadcast room activities are rising. When a live room activity is performed, the number of users in the same live room is large, the interaction between the users and the anchor is more, and the information change of the live room during the activity usually needs to be recorded in real time.

Disclosure of Invention

This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

In a first aspect, the present disclosure provides a message processing method, including:

after receiving a point updating message for a target account, determining whether point information of the target account can be updated according to the point updating message;

if the integral information of the target account cannot be updated according to the integral updating message is determined, storing the integral updating message to a delay queue when the waiting time of the integral updating message exceeds a time threshold;

determining a delay time for the credit update message to be removed from the delay queue to remove the credit update message from the delay queue based on the delay time;

and processing the shifted-out integral updating message.

In a second aspect, the present disclosure provides a message processing apparatus, the apparatus comprising:

the system comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining whether the point information of a target account can be updated according to a point updating message after the point updating message for the target account is received;

the first storage module is used for storing the point updating message to a delay queue when the waiting duration of the point updating message exceeds a time threshold under the condition that the point information of the target account cannot be updated according to the point updating message;

a second determining module, configured to determine a delay time for removing the credit update message from the delay queue, so as to remove the credit update message from the delay queue based on the delay time;

and the processing module is used for processing the shifted-out integral updating message.

In a third aspect, a computer-readable medium is provided, on which a computer program is stored, which program, when being executed by a processing device, carries out the steps of the method according to the first aspect.

In a fourth aspect, an electronic device is provided, comprising:

a storage device having a computer program stored thereon;

processing means for executing the computer program in the storage means to carry out the steps of the method of the first aspect.

In the technical scheme, after receiving the point updating message aiming at the target account, whether the point information of the target account can be updated according to the point updating message is determined; and when determining that the integral information of the target account cannot be updated according to the integral updating message, storing the integral updating message into a delay queue when the waiting time of the integral updating message exceeds a time threshold, thereby effectively avoiding message blocking caused by too many integral updating messages in a waiting state and ensuring the stability of message processing. Meanwhile, the integral updating message is removed from the delay queue and processed, so that the risk of losing the integral updating message can be effectively reduced, and the real-time performance and the accuracy of the updating of the integral information are ensured.

Additional features and advantages of the disclosure will be set forth in the detailed description which follows.

Drawings

The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:

fig. 1 is a flow chart of a message processing method provided according to an embodiment of the present disclosure;

FIG. 2 is a block diagram of a message processing apparatus provided in accordance with one embodiment of the present disclosure;

fig. 3 is a schematic structural diagram of an electronic device provided according to an embodiment of the present disclosure.

Detailed Description

Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.

It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.

The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.

It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.

It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.

The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.

Fig. 1 is a flowchart of a message processing method according to an embodiment of the present disclosure, where as shown in fig. 1, the method includes:

in S11, after receiving the point update message for the target account, it is determined whether the point information of the target account can be updated according to the point update message.

As described in the background section, the method provided by the present disclosure may be applied to a scene of the integral update message processing in the live broadcast. However, because the point change messages in the live broadcast room are numerous, in order to avoid inconsistency of the point information caused by simultaneous processing of the point update messages, it is necessary to determine whether the point information of the target account can be updated according to the point update messages.

Optionally, an exemplary implementation manner of determining whether the point information of the target account can be updated according to the point updating message is as follows, and the step may include:

and determining the state of an integral lock corresponding to the integral information, wherein the integral lock is used for controlling the update of the integral information. In this embodiment, in order to ensure the accuracy of the credit update operation, a processing mechanism for locking the credit information is adopted, wherein the credit lock may be a time-waiting lock, and the waiting processing time of the credit update message may be constrained by setting the waiting duration of the time-waiting lock. Therefore, when the point information is updated according to a point update message, the point information is locked, so that during the update period, other point update messages are in a waiting state for processing, and processing is performed after the point lock is released.

And if the state of the integral lock is a locking state, determining that the integral information of the target account cannot be updated according to the integral updating message. If the state of the integral lock is a locked state, it indicates that the integral information is being updated according to another integral update message, and at this time, it cannot be determined that the integral information of the target account cannot be updated according to the integral update message.

And if the state of the integral lock is an idle state, determining to update the integral information according to the integral update message. And if the state of the integral lock is an idle state, the integral lock indicates that the integral information is not updated currently, and the integral information can be updated according to the integral updating message. Therefore, the method and the device can ensure that only one of the integral information is updated at the same time, and ensure the consistency and accuracy of the updating of the integral information.

In S12, if it is determined that the point information of the target account cannot be updated according to the point update message, the point update message is stored in the delay queue when the waiting time of the point update message exceeds the time threshold.

When it is determined that the point information of the target account cannot be updated according to the point updating message, the point updating message is in a waiting state, and the waiting duration is the duration of a time period corresponding to the current time from the receiving time of the point waiting message.

In S13, a delay time for removing the tally update message from the delay queue is determined to remove the tally update message from the delay queue based on the delay time.

And if the delay time is the time for storing the integral updating message in the delay queue, the time length from the enqueue time to the dequeue time of the integral updating message is the delay time. Therefore, when the storage time of the integral updating message in the delay queue is determined to reach the delay time, the integral updating message can be directly removed from the delay queue.

In S14, the shifted out point update message is processed.

The moved-out integral updating message is processed, and the moved-out integral updating message can be processed as a newly received integral updating message; or the shifted-out integral update message is preferentially processed after the shift-out, namely the integral information is updated according to the shifted-out integral update message. It should be noted that, when the integral update message is processed, the integral update message is processed according to the sequence of the received time.

In the technical scheme, after receiving the point updating message aiming at the target account, whether the point information of the target account can be updated according to the point updating message is determined; and when determining that the integral information of the target account cannot be updated according to the integral updating message, storing the integral updating message into a delay queue when the waiting time of the integral updating message exceeds a time threshold, thereby effectively avoiding message blocking caused by too many integral updating messages in a waiting state and ensuring the stability of message processing. Meanwhile, the integral updating message is removed from the delay queue and processed, so that the risk of losing the integral updating message can be effectively reduced, and the real-time performance and the accuracy of the updating of the integral information are ensured.

Optionally, if it is determined that the point information of the target account can be updated according to the point update message after receiving the point update message for the target account, the point information of the target account can be directly updated according to the point update message.

Optionally, the delay time for the credit update message to be removed from the delay queue may be determined by:

Td=Tbase+random()

wherein, TdFor representing the delay time;

Tbasethe device is used for representing a preset reference delay time; the reference delay time can be set according to actual use scenes, and the comparison of the disclosure is not limited.

random () represents a random function, wherein the range of the random number generated by the random function can be set based on the actual usage scenario, for example, for a scenario with strict real-time requirement, the range of the random number is set to be smaller, and for a scenario with relaxed real-time requirement, the range of the random number can be set to be slightly larger.

Through the technical scheme, the dequeuing time of the integral updating messages in the delay queue is dispersed in a mode of generating random numbers through a random function, so that the dequeuing time of the integral updating messages in the delay queue is different, the time for each shifted integral updating message to reach the integral updating message processing flow is different, and the pressure of multi-message processing is further relieved.

Optionally, after receiving the point update message for the target account, before the step of determining whether the point information of the target account can be updated according to the point update message, the method may further include:

and determining whether the message identifier of the received point updating message is stored in a database, and if the message identifier is not stored in the database, executing the step of determining whether the point information of the target account can be updated according to the point updating message.

Wherein, the message identifier of the score update message is used to uniquely represent the score update message, for example, the message identifier may be an ID or a digest of the score update message.

Optionally, after the step of processing the removed credit update message, the method further includes:

storing the message identification in the database.

In the above embodiment, the message identifier stored in the database is the message identifier of the point update message that has been processed. Therefore, after receiving the point updating message for the target account, before determining whether the point information of the target account can be updated according to the point updating message, whether the message identifier of the point updating message is stored in the database can be inquired, so as to determine whether the point updating message is processed, thereby effectively avoiding repeated processing of the point updating message, and ensuring the accuracy and efficiency of updating the point information.

Optionally, the database may be a Remote Dictionary service (Redis), which is an open-source journal-type Key-Value database written in ANSI C language, supporting network, and may be based on memory or persistent. The message identification is stored based on the Redis database, so that the searching efficiency of the message identification can be effectively improved, and the message processing efficiency is improved.

Optionally, the method may further include:

and determining the storage duration of the message identifier in the database, and deleting the message identifier from the database if the storage duration exceeds a duration threshold.

The storage duration of the message identifier is the duration of the time period from the storage time of the message identifier in the database to the current time. For example, the duration threshold may be set according to an actual usage scenario, for example, the duration threshold is set to 1 hour, and therefore, if the duration of the message identifier stored in the database reaches 1 hour, the message identifier is deleted from the database.

Alternatively, the method may further include:

and deleting the message identifier of which the time length from the current time to the storage time in the database is greater than a second time length threshold value at every preset time interval.

The preset time may be set according to an actual usage scenario, for example, for a scenario in which the number of integral update messages generated in a unit time is large, the preset time may be set to a shorter interval, for example, 20 minutes, and for a scenario in which the number of integral update messages generated in a unit time is small, the preset time may be set to a longer interval, for example, 40 minutes.

The second duration threshold may be the same as or different from the first duration threshold, which is not limited in this disclosure. Illustratively, the second duration threshold is 40 minutes, and the preset time is 20 minutes, in this embodiment, the message identifier stored in the database before 40 minutes may be deleted every 20 minutes.

In the process of message communication interaction, the resendable time and the survival time of the message are usually limited by time, so that by the technical scheme, the message identifier of the recently processed section updating message can be stored, and the expired message identifier in the database can be cleared in time, so that the occupation amount of the storage resources of the database can be reduced, and the efficiency of searching the message identifier can be further improved.

Optionally, the method further comprises:

and acquiring a total value of the integral information of the target account in a target time period, wherein the total value of the integral information is a change value of the integral information of the target account corresponding to the starting time to the ending time of the target time period. Wherein, the starting time and the ending time of the target time interval can be set according to the actual use scene.

Optionally, the methods provided by the present disclosure may be applied to message processing scenarios for an integrated activity period. Then in this scenario, the target time period may be a time period corresponding to the beginning time to the ending time of the integration activity, such as 6:00-10: 00. For another example, in order to further improve the accuracy of the point information, the target time interval may be a certain segment within the point activity time interval, for example, the target time interval may be determined every other time interval, for example, 6:00-7:00, 6:00-8:00, 6:00-9:00, 6:00-10:00 are respectively used as the target time interval, so as to obtain the point information accumulated value of the target account within the target time interval.

And acquiring the corresponding point information change value of the target account recorded by the wallet system in the target time period. The wallet system is used for changing assets based on a target account, and the change is usually performed in a segmented updating mode, so that the consistency of transaction processing can be ensured. Therefore, the asset change value corresponding to the target account in the wallet system in the target time period can be determined, and the credit information change value can be further determined according to the corresponding relation between the asset and the credit. The corresponding relationship between the assets and the points is preset according to the service requirements, and is not described herein.

If the absolute value of the difference value between the accumulated value of the integral information and the variation value of the integral information is smaller than an integral difference threshold value, keeping the integral information of the target account unchanged;

and if the absolute value of the difference value between the accumulated integral information value and the change value of the integral information is greater than or equal to the integral difference threshold value, determining an integral adjustment value according to the accumulated integral information value and the change value of the integral information, and adjusting the integral information of the target account according to the integral adjustment value.

The integral difference threshold may be set according to an actual usage scenario, for example, the integral difference threshold may be set to 20, and if the absolute value of the difference between the integral information accumulated value and the integral information change value is less than 20, it indicates that the two are close, and at this time, the integral information of the target account may be considered to be accurate, and the integral information of the target account is kept unchanged. If the absolute value of the difference between the accumulated value of the point information and the change value of the point information is greater than or equal to 20, and the difference between the two is large, the point information of the target account can be updated based on the point value obtained by the wallet system.

As an example, a weighted average of the integrated information change value and the integrated information integrated value may be taken as the integrated information correction value, and a result of subtracting the integrated information integrated value from the integrated information correction value may be taken as the integration adjustment value. When the integral information is adjusted, the integral adjustment value is accumulated on the basis of the current integral information accumulation value.

As another example, a weighted average value of the variation value of the integral information and the accumulated value of the integral information may be used as an integral adjustment value, and when the integral information of the target account is adjusted according to the integral adjustment value, the current accumulated value of the integral information may be directly modified to the integral adjustment value.

When determining the weighted average value of the integral information change value and the integral information cumulative value, the weights corresponding to the integral information change value and the integral information cumulative value may be set according to an actual usage scenario, which is not limited in this disclosure.

Through the technical scheme, the point information updated in real time based on the point updating information can be corrected according to the point information recorded in the wallet system, so that the accuracy of the point information can be further improved, the accuracy of information processing is ensured, and the use experience of a user is improved.

Optionally, after the point information of the target account is adjusted according to the point adjustment value, an adjustment log may be generated to record the adjusted information, so that the whole accumulation process of the point information can be conveniently traced and queried based on the log.

The present disclosure also provides a message processing apparatus, as shown in fig. 2, the apparatus 10 includes:

a first determining module 100, configured to determine, after receiving a point update message for a target account, whether point information of the target account can be updated according to the point update message;

a first storage module 200, configured to, when it is determined that the point information of the target account cannot be updated according to the point update message, store the point update message in a delay queue when a waiting duration of the point update message exceeds a time threshold;

a second determining module 300, configured to determine a delay time for removing the credit update message from the delay queue, so as to remove the credit update message from the delay queue based on the delay time;

a processing module 400, configured to process the removed credit update message.

Optionally, the second determining module is configured to determine the delay time for moving the credit update message out of the delay queue by:

Td=Tbase+random()

wherein, TdFor representing the delay time;

Tbasethe device is used for representing a preset reference delay time;

random () represents a random function.

Optionally, the apparatus further comprises:

a third determining module, configured to determine whether a message identifier of the received credit update message is stored in a database before the first determining module determines whether the credit information of the target account can be updated according to the credit update message after receiving the credit update message for the target account, and trigger the first determining module to determine whether the credit information of the target account can be updated according to the credit update message if it is determined that the message identifier is not stored in the database.

Optionally, the apparatus further comprises:

and the second storage module is used for storing the message identifier into the database after the processing module processes the moved score updating message.

Optionally, the apparatus further comprises:

the first deleting module is used for determining the storage duration of the message identifier in the database, and deleting the message identifier from the database if the storage duration exceeds a first duration threshold;

or

And the second deleting module is used for deleting the message identifier of which the time length from the current time to the storage time in the database is greater than a second time length threshold value every preset time interval.

Optionally, the first determining module includes:

the first determining submodule is used for determining the state of an integral lock corresponding to the integral information, wherein the integral lock is used for controlling the updating of the integral information;

the second determination submodule is used for determining that the integral information of the target account cannot be updated according to the integral updating message under the condition that the state of the integral lock is a locking state;

and the third determining submodule is used for determining to update the integral information according to the integral updating message under the condition that the state of the integral lock is an idle state.

Optionally, the apparatus further comprises:

the first acquisition module is used for acquiring the accumulated value of the integral information of the target account in a target time period;

the second acquisition module is used for acquiring the corresponding point information change value of the target account recorded by the wallet system in the target time period;

the adjustment submodule is used for keeping the integral information of the target account unchanged under the condition that the absolute value of the difference value between the integral information accumulated value and the integral information change value is smaller than an integral difference threshold value; and under the condition that the absolute value of the difference value between the integrated information accumulated value and the integrated information change value is greater than or equal to the integrated difference threshold value, determining an integrated adjustment value according to the integrated information accumulated value and the integrated information change value, and adjusting the integrated information of the target account according to the integrated adjustment value.

Referring now to FIG. 3, a block diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.

As shown in fig. 3, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.

Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.

In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.

It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.

In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.

The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.

The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: after receiving a point updating message for a target account, determining whether point information of the target account can be updated according to the point updating message; if the integral information of the target account cannot be updated according to the integral updating message is determined, storing the integral updating message to a delay queue when the waiting time of the integral updating message exceeds a time threshold; determining a delay time for the credit update message to be removed from the delay queue to remove the credit update message from the delay queue based on the delay time; and processing the shifted-out integral updating message.

Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not constitute a limitation to the module itself in some cases, for example, the first determination module may also be described as a "module that determines whether the point information of the target account can be updated according to the point update message after receiving the point update message for the target account".

The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

According to one or more embodiments of the present disclosure, there is provided a message processing method including:

after receiving a point updating message for a target account, determining whether point information of the target account can be updated according to the point updating message;

if the integral information of the target account cannot be updated according to the integral updating message is determined, storing the integral updating message to a delay queue when the waiting time of the integral updating message exceeds a time threshold;

determining a delay time for the credit update message to be removed from the delay queue to remove the credit update message from the delay queue based on the delay time;

and processing the shifted-out integral updating message.

According to one or more embodiments of the present disclosure, there is also provided a message processing method, wherein the delay time for moving the credit update message out of the delay queue is determined by:

Td=Tbase+random()

wherein, TdFor representing the delay time;

Tbasethe device is used for representing a preset reference delay time;

random () represents a random function.

According to one or more embodiments of the present disclosure, there is also provided a message processing method, wherein after receiving a point update message for a target account, before the step of determining whether the point information of the target account can be updated according to the point update message, the method further includes:

and determining whether the message identifier of the received point updating message is stored in a database, and if the message identifier is not stored in the database, executing the step of determining whether the point information of the target account can be updated according to the point updating message.

According to one or more embodiments of the present disclosure, there is also provided a message processing method, where after the step of processing the removed point update message, the method further includes:

storing the message identification in the database.

According to one or more embodiments of the present disclosure, there is also provided a message processing method, wherein the method further includes:

determining the storage duration of the message identifier in the database, and deleting the message identifier from the database if the storage duration exceeds a first duration threshold;

or

And deleting the message identifier of which the time length from the current time to the storage time in the database is greater than a second time length threshold value at every preset time interval.

According to one or more embodiments of the present disclosure, there is also provided a message processing method, in which the determining whether the point information of the target account can be updated according to the point update message includes:

determining the state of an integration lock corresponding to the integration information, wherein the integration lock is used for controlling the updating of the integration information;

if the state of the integral lock is a locking state, determining that the integral information of the target account cannot be updated according to the integral updating message;

and if the state of the integral lock is an idle state, determining to update the integral information according to the integral update message.

According to one or more embodiments of the present disclosure, there is also provided a message processing method, wherein the method further includes:

acquiring a point information accumulated value of the target account in a target time period;

acquiring a point information change value corresponding to the target account recorded by the wallet system in the target time period;

if the absolute value of the difference value between the accumulated value of the integral information and the variation value of the integral information is smaller than an integral difference threshold value, keeping the integral information of the target account unchanged;

and if the absolute value of the difference value between the accumulated integral information value and the change value of the integral information is greater than or equal to the integral difference threshold value, determining an integral adjustment value according to the accumulated integral information value and the change value of the integral information, and adjusting the integral information of the target account according to the integral adjustment value.

According to one or more embodiments of the present disclosure, there is also provided a message processing apparatus, wherein the apparatus includes:

the system comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining whether the point information of a target account can be updated according to a point updating message after the point updating message for the target account is received;

the first storage module is used for storing the point updating message to a delay queue when the waiting duration of the point updating message exceeds a time threshold under the condition that the point information of the target account cannot be updated according to the point updating message;

a second determining module, configured to determine a delay time for removing the credit update message from the delay queue, so as to remove the credit update message from the delay queue based on the delay time;

and the processing module is used for processing the shifted-out integral updating message.

According to one or more embodiments of the present disclosure, there is further provided a message processing apparatus, wherein the second determining module is configured to determine the delay time for the credit update message to be removed from the delay queue by:

Td=Tbase+random()

wherein, TdFor representing the delay time;

Tbasethe device is used for representing a preset reference delay time;

random () represents a random function.

According to one or more embodiments of the present disclosure, there is also provided a message processing apparatus, wherein the apparatus further includes:

a third determining module, configured to determine whether a message identifier of the received credit update message is stored in a database before the first determining module determines whether the credit information of the target account can be updated according to the credit update message after receiving the credit update message for the target account, and trigger the first determining module to determine whether the credit information of the target account can be updated according to the credit update message if it is determined that the message identifier is not stored in the database.

According to one or more embodiments of the present disclosure, there is also provided a message processing apparatus, wherein the apparatus further includes:

and the second storage module is used for storing the message identifier into the database after the processing module processes the moved score updating message.

According to one or more embodiments of the present disclosure, there is also provided a message processing apparatus, wherein the apparatus further includes:

the first deleting module is used for determining the storage duration of the message identifier in the database, and deleting the message identifier from the database if the storage duration exceeds a first duration threshold;

or

And the second deleting module is used for deleting the message identifier of which the time length from the current time to the storage time in the database is greater than a second time length threshold value every preset time interval.

According to one or more embodiments of the present disclosure, there is also provided a message processing apparatus, wherein the first determining module includes:

the first determining submodule is used for determining the state of an integral lock corresponding to the integral information, wherein the integral lock is used for controlling the updating of the integral information;

the second determination submodule is used for determining that the integral information of the target account cannot be updated according to the integral updating message under the condition that the state of the integral lock is a locking state;

and the third determining submodule is used for determining to update the integral information according to the integral updating message under the condition that the state of the integral lock is an idle state.

According to one or more embodiments of the present disclosure, there is also provided a message processing apparatus, wherein the apparatus further includes:

the first acquisition module is used for acquiring the accumulated value of the integral information of the target account in a target time period;

the second acquisition module is used for acquiring the corresponding point information change value of the target account recorded by the wallet system in the target time period;

the adjustment submodule is used for keeping the integral information of the target account unchanged under the condition that the absolute value of the difference value between the integral information accumulated value and the integral information change value is smaller than an integral difference threshold value; and under the condition that the absolute value of the difference value between the integrated information accumulated value and the integrated information change value is greater than or equal to the integrated difference threshold value, determining an integrated adjustment value according to the integrated information accumulated value and the integrated information change value, and adjusting the integrated information of the target account according to the integrated adjustment value.

According to one or more embodiments of the present disclosure, there is also provided a computer-readable medium, on which a computer program is stored, which when executed by a processing device, implements the steps of any of the message processing methods described above.

According to one or more embodiments of the present disclosure, there is also provided an electronic device, including:

a storage device having a computer program stored thereon;

processing means for executing the computer program in the storage means to implement the steps of any of the message processing methods described above.

The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:直播流显示方法、装置、电子设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类