Information processing method and apparatus, storage medium, and processor

By reading target message tasks from the fire monitoring platform and managing their dormant state and Redis transaction locks, the problem of data requests failing to transmit normally under account request frequency limits was solved, achieving effective data request transmission and improved efficiency.

CN113535337BActive Publication Date: 2026-04-14CHINA XIAOYUN (BEIJING) INTERNET OF THINGS TECH RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA XIAOYUN (BEIJING) INTERNET OF THINGS TECH RES INST CO LTD
Filing Date
2021-06-07
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In the construction of smart cities, the fire protection monitoring platform has a limit on the frequency of account requests, which leads to the problem that data requests cannot be transmitted normally when the frequency of account requests does not meet the requirements.

Method used

By reading the target message task from the message monitoring platform, it is determined whether the number of data requests within the first preset time period is not greater than a preset value. If it is not greater, it enters a sleep state and releases the target transaction lock. The Redis distributed transaction lock is used for locking and unlocking to meet the request frequency limit.

Benefits of technology

This ensures that data requests can be transmitted normally even under the request frequency limit of the fire monitoring platform, avoiding deadlock and improving data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535337B_ABST
    Figure CN113535337B_ABST
Patent Text Reader

Abstract

The application discloses an information processing method and device, a storage medium and a processor. The method comprises the following steps: reading a target message task from a message supervision platform; if a target transaction lock exists in an account corresponding to the target message task, obtaining a data request frequency of the target message task; judging whether the data request frequency in a first preset time period is not greater than a preset value; if the data request frequency in the first preset time period is not greater than the preset value, the target message task enters a dormant state, and the target transaction lock of the account corresponding to the target message task is released. Through the application, the problem that data requests cannot be normally transmitted when the account request frequency does not meet the limitation requirement in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information data processing technology, and more specifically, to an information processing method, apparatus, storage medium, and processor. Background Technology

[0002] Against the backdrop of the booming development of smart city construction, fire safety supervision departments at all levels will deploy monitoring platforms and require all fire hazard prevention and control platforms used in communities to synchronize data to the monitoring platforms in real time. Meanwhile, to prevent hacking, some monitoring platforms will limit the request frequency of individual accounts, for example, limiting a single account to no more than three requests per second. If more than three requests are made per second, an error message will be displayed: "Request frequency too high," and the requested data will not be sent.

[0003] There is currently no effective solution to the problem that data requests cannot be transmitted normally when the account request frequency does not meet the limit requirements in related technologies. Summary of the Invention

[0004] The main objective of this application is to provide an information processing method, apparatus, storage medium, and processor to solve the problem in related technologies where data requests cannot be transmitted normally when the account request frequency does not meet the limit requirements.

[0005] To achieve the above objectives, according to one aspect of this application, an information processing method is provided. The method includes: reading a target message task from a message monitoring platform; if the account corresponding to the target message task has a target transaction lock, obtaining the number of data requests for the target message task; determining whether the number of data requests within a first preset time period is not greater than a preset value; if the number of data requests within the first preset time period is not greater than the preset value, then the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task.

[0006] Furthermore, if the number of data requests within the first preset duration is not greater than a preset value, then the target message task enters a dormant state, which includes: if the number of data requests within the first preset duration is not greater than a preset value, setting the target message task to enter a dormant state within a second preset duration, wherein the second preset duration is less than the first preset duration.

[0007] Furthermore, if the account corresponding to the target message task has a target transaction lock, before obtaining the data request count of the target message task, the method further includes: determining whether a target transaction lock exists in the account corresponding to the target message task; if the account corresponding to the target message task has a target transaction lock, then executing the data request of the target message task; and using the number of times the data request of the target message task is executed as the data request count.

[0008] Furthermore, if the account corresponding to the target message task has a target transaction lock, the method further includes, before executing the data request for the target message task, locking the account corresponding to the target message task based on the target instruction, wherein the account corresponding to the target message task has a target transaction lock after the locking process.

[0009] Furthermore, the target name in Redis corresponding to the target transaction lock includes the account of the target message task, and the target content in Redis corresponding to the target transaction lock includes the timestamp when the target instruction was executed. After locking the account corresponding to the target message task based on the target transaction lock, the method further includes: determining whether the valid time is greater than a third preset duration, where the valid time refers to the valid time of the account corresponding to the target message task after the locking process; if the valid time is greater than the third preset duration, then determining whether the valid time is greater than a fourth preset duration based on the timestamp; if the valid time is greater than the fourth preset duration, releasing the target transaction lock and deleting the released target transaction lock.

[0010] Furthermore, if the number of data requests within the first preset time period is not greater than a preset value, the target message task enters a dormant state, and releasing the target transaction lock of the account corresponding to the target message task includes: if the number of data requests within the first preset time period is not greater than a preset value, unlocking the account corresponding to the target message task based on the target transaction lock; after unlocking the account corresponding to the target message task, releasing the target transaction lock of the account corresponding to the target message task.

[0011] To achieve the above objectives, according to another aspect of this application, an information processing apparatus is provided. The apparatus includes: a first acquisition unit, configured to read a target message task from a message monitoring platform; a second acquisition unit, configured to acquire the number of data requests for the target message task if the account corresponding to the target message task has a target transaction lock; a first judgment unit, configured to judge whether the number of data requests within a first preset time period is not greater than a preset value; and a first processing unit, configured to, if the number of data requests within the first preset time period is not greater than the preset value, then the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task.

[0012] Furthermore, the first processing unit includes: a first setting module, configured to set the target message task to enter a sleep state within a second preset time if the number of data requests within a first preset time is not greater than a preset value, wherein the second preset time is less than the first preset time.

[0013] Furthermore, the device also includes: a second determining unit, configured to determine whether a target transaction lock exists in the account corresponding to the target message task before obtaining the number of data requests for the target message task if a target transaction lock exists in the account corresponding to the target message task; a first executing unit, configured to execute the data request for the target message task if a target transaction lock exists in the account corresponding to the target message task; and a third obtaining unit, configured to use the number of times the data request for the target message task is executed as the number of data requests.

[0014] Furthermore, the device also includes: a second processing unit, configured to, before executing the data request for the target message task, lock the account corresponding to the target message task based on the target instruction if the account corresponding to the target message task has a target transaction lock, wherein the account corresponding to the target message task after the locking process has a target transaction lock.

[0015] Furthermore, the target name in Redis corresponding to the target transaction lock includes the account of the target message task, and the target content in Redis corresponding to the target transaction lock includes the timestamp when the target instruction was executed. After locking the account corresponding to the target message task based on the target transaction lock, the device further includes: a third judgment unit, used to determine whether the valid time is greater than a third preset duration, wherein the valid time refers to the valid time of the account corresponding to the target message task after the locking process; a fourth judgment unit, used to determine whether the valid time is greater than a fourth preset duration based on the timestamp if the valid time is greater than the third preset duration; and a third processing unit, used to release the target transaction lock and delete the released target transaction lock if the valid time is greater than the fourth preset duration.

[0016] Furthermore, the first processing unit includes: a first processing module, used to unlock the account corresponding to the target message task based on the target transaction lock if the number of data requests within a first preset time period is not greater than a preset value; and a first release module, used to release the target transaction lock of the account corresponding to the target message task after the account corresponding to the target message task has been unlocked.

[0017] This application employs the following steps: reading the target message task from the message monitoring platform; if the account corresponding to the target message task has a target transaction lock, obtaining the number of data requests for the target message task; determining whether the number of data requests within a first preset time period is not greater than a preset value; if the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state and releases the target transaction lock for the account corresponding to the target message task. This solves the problem in related technologies where data requests cannot be transmitted normally when the account request frequency does not meet the limit requirements. By determining whether the number of data requests within a first preset time period is not greater than a preset value, and if the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state, thereby achieving the effect that the number of data requests for the target message task meets the limit requirements and data requests can be transmitted normally. Attached Figure Description

[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0019] Figure 1 This is a flowchart of an information processing method provided according to an embodiment of this application;

[0020] Figure 2 This is a schematic diagram of the system operation of the information processing method provided in the embodiments of this application;

[0021] Figure 3 This is a flowchart of a message request according to an embodiment of the information processing method provided in this application; and

[0022] Figure 4 This is a schematic diagram of an information processing apparatus provided according to an embodiment of this application. Detailed Implementation

[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:

[0027] Kafka is an open-source stream processing platform developed by the Apache Software Foundation. It is a high-throughput distributed publish-subscribe messaging system that can process all action streams of data from consumers on a website.

[0028] Redis: Remote Dictionary Server is an open-source, network-enabled, in-memory or persistent, log-structured, key-value database written in ANSI C, and provides APIs for multiple languages.

[0029] According to an embodiment of this application, an information processing method is provided.

[0030] Figure 1 This is a flowchart of an information processing method according to an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps:

[0031] Step S101: Read the target message task from the message monitoring platform.

[0032] Figure 2 This is a system operation diagram of the information processing method provided in the embodiments of this application, such as... Figure 2 As shown, when static and dynamic information changes on the community fire hazard prevention and control platform, the changed information is immediately sent to the Kafka message queue (corresponding to the message monitoring platform in this application, hereinafter the same). The Kafka message queue organizes the individual messages into a format that is consistent with the fire monitoring platform and synchronizes them to the fire monitoring platform. Static information includes networked units, buildings, fire control rooms, controllers, IoT terminals, components, monitoring equipment, etc.; dynamic information includes alarm information, events, video alarm information, operation information, etc.

[0033] For example, if a fire breaks out in a unit and the unit issues a request for urgent fire assistance, the community fire hazard prevention and control platform quickly sends the fire rescue request information (corresponding to the target message task in this application) to a Kafka message queue. Because the fire supervision platform has a limit on the number of requests it can make to the Kafka message queue, the fire rescue request information in the Kafka message queue cannot be directly sent to the fire supervision platform. It needs to be formatted individually to match the request limit set by the fire supervision platform before being sent. Therefore, to ensure that the request count for this target message task meets the unified format set by the fire supervision platform, the target message task needs to be retrieved from the Kafka message queue first.

[0034] Step S102: If the account corresponding to the target message task has a target transaction lock, then obtain the number of data requests for the target message task.

[0035] Figure 3 This is a flowchart of a message request according to an embodiment of the information processing method provided in this application, such as... Figure 3 As shown, the process begins by retrieving the target message task from the Kafka message queue in the regulatory information, and then acquiring a Redis distributed transaction lock for the target message task. Before executing the request, it is necessary to determine whether the account corresponding to the target message task has the target transaction lock.

[0036] Optionally, in the information processing method provided in this application embodiment, if the account corresponding to the target message task has a target transaction lock, before executing the data request of the target message task, the method further includes: locking the account corresponding to the target message task based on the target instruction, wherein the account corresponding to the target message task after locking has a target transaction lock.

[0037] Specifically, the Redis SETNX command (corresponding to the target command in this application) is used to lock the account corresponding to the target message task, so that the account corresponding to the target message task contains a Redis distributed transaction lock.

[0038] Optionally, in the information processing method provided in this application embodiment, if the account corresponding to the target message task has a target transaction lock, before obtaining the number of data requests for the target message task, the method further includes: determining whether there is a target transaction lock in the account corresponding to the target message task; if the account corresponding to the target message task has a target transaction lock, then executing the data request for the target message task; and using the number of times the data request for the target message task is executed as the number of data requests.

[0039] For example, if the target message task is a fire rescue request, after the account corresponding to the fire rescue request acquires the Redis distributed transaction lock (corresponding to the target transaction lock in this application, the same below), it executes the data request for the target message task 3 times. The number of data requests to obtain the fire rescue request information is determined by this application. Only when the account corresponding to the target message task has the target transaction lock can the data request be executed, so that the target message task under a single account is not affected by the outside world when it is sent, and the execution efficiency of the data request is higher.

[0040] Step S103: Determine whether the number of data requests within the first preset time period is not greater than a preset value.

[0041] For example, if a fire rescue request is executed 3 times, and assuming that the number of requests within 1 second (corresponding to the first preset duration in this application) is not allowed to exceed 3 times within the time specified by the fire supervision platform, then it can be determined that the number of data requests for the fire rescue request does not exceed 3 times.

[0042] Step S104: If the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task.

[0043] like Figure 3 As shown, the number of data requests obtained in step S102 is limited to a sleep period of time according to the request frequency. Optionally, in the information processing method provided in this application embodiment, if the number of data requests within the first preset time period is not greater than a preset value, the target message task enters a sleep state, which includes: if the number of data requests within the first preset time period is not greater than a preset value, the target message task is set to enter a sleep state within a second preset time period, wherein the second preset time period is less than the first preset time period.

[0044] For example, if a fire rescue request is executed 3 times, and the fire monitoring platform stipulates that the number of requests within 1 second (corresponding to the first preset duration in this application) shall not exceed 3, that is, the number of requests for the fire rescue request shall not exceed 3 within 1 second, then after the fire rescue request is executed 3 times, the fire rescue request is set to enter a dormant state within 350ms after the data request is completed. The dormant state time can also be set to any value greater than 333ms and less than 1 second.

[0045] Optionally, in the information processing method provided in this application embodiment, if the number of data requests within a first preset time period is not greater than a preset value, the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task, including: if the number of data requests within the first preset time period is not greater than a preset value, unlocking the account corresponding to the target message task based on the target transaction lock; and after unlocking the account corresponding to the target message task, releasing the target transaction lock of the account corresponding to the target message task.

[0046] As shown in the example above, after the hibernation state ends, the account corresponding to the fire rescue request information needs to be unlocked to ensure that there is no Redis distributed transaction lock. Then, the Redis distributed transaction lock is released so that it no longer occupies lock resources and can be used for the next data request. In addition, the number of requests for the fire rescue request information meets the limit of no more than 3 times within 1 second, which complies with the request limit of the fire supervision platform within the time period. Therefore, the information data can be successfully sent to the fire supervision platform for transmission.

[0047] Specifically, when the account corresponding to the target message task in this application has a target transaction lock, it is necessary to handle the lock timeout situation to further ensure that the requested data can be transmitted normally.

[0048] Optionally, in the information processing method provided in this application embodiment, the target name of the Redis corresponding to the target transaction lock includes the account of the target message task, and the target content of the Redis corresponding to the target transaction lock includes the timestamp when the target instruction is executed. After locking the account corresponding to the target message task based on the target transaction lock, the method further includes: determining whether the effective time is greater than a third preset duration, wherein the effective time refers to the effective time of the account corresponding to the target message task after the locking process; if the effective time is greater than the third preset duration, determining whether the effective time is greater than a fourth preset duration based on the timestamp; if the effective time is greater than the fourth preset duration, releasing the target transaction lock and deleting the released target transaction lock.

[0049] Specifically, the target name (or key value) in Redis corresponding to the target transaction lock contains the account of the target message task, and the target content (or value value) in Redis corresponding to the target transaction lock contains the timestamp when the target instruction was executed. By checking whether the validity period set in the key value in Redis exceeds the predetermined time (corresponding to the third preset duration in this application), if it exceeds, it proves that the target transaction lock has timed out. In order to avoid deadlock, it is also necessary to determine whether the validity period exceeds the predetermined time when the lock timed out (corresponding to the fourth preset duration in this application) based on the timestamp in the value value in Redis. The fourth preset duration is greater than or equal to the third preset duration. This application further determines the deadlock caused by lock timeout through the timestamp, so that the data system request process is not permanently locked and the data request can be transmitted normally.

[0050] In summary, the information processing method provided in this application reads a target message task from a message monitoring platform; if the account corresponding to the target message task has a target transaction lock, the number of data requests for the target message task is obtained; it is determined whether the number of data requests within a first preset time period is not greater than a preset value; if the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task. This solves the problem in related technologies where data requests cannot be transmitted normally when the account request frequency does not meet the limit requirements. By determining whether the number of data requests within a first preset time period is not greater than a preset value, and if the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state, thereby achieving the effect that the number of data requests for the target message task meets the limit requirements and the data requests can be transmitted normally.

[0051] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0052] This application also provides an information processing apparatus. It should be noted that the information processing apparatus of this application can be used to execute the information processing method provided in this application. The information processing apparatus provided in this application will be described below.

[0053] Figure 4 This is a schematic diagram of an information processing apparatus according to an embodiment of this application. Figure 4 As shown, the device includes: a first acquisition unit 401, a second acquisition unit 402, a first judgment unit 403, and a first processing unit 404.

[0054] Specifically, the first acquisition unit 401 is used to read the target message task from the message monitoring platform;

[0055] The second acquisition unit 402 is used to acquire the number of data requests for the target message task if the account corresponding to the target message task has a target transaction lock.

[0056] The first judgment unit 403 is used to determine whether the number of data requests within the first preset time period is not greater than a preset value;

[0057] The first processing unit 404 is configured to, if the number of data requests within a first preset time period is not greater than a preset value, then the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task.

[0058] In summary, the information processing apparatus provided in this application embodiment reads the target message task from the message monitoring platform through the first acquisition unit 401; if the account corresponding to the target message task has a target transaction lock, the second acquisition unit 402 acquires the number of data requests for the target message task; the first judgment unit 403 judges whether the number of data requests within a first preset time period is not greater than a preset value; if the number of data requests within the first preset time period is not greater than the preset value, the first processing unit 404 puts the target message task into a dormant state and releases the target transaction lock of the account corresponding to the target message task. This solves the problem in related technologies where data requests cannot be transmitted normally when the account request frequency does not meet the limit requirements. By judging whether the number of data requests within the first preset time period is not greater than the preset value, if the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state, thereby achieving the effect that the number of data requests for the target message task meets the limit requirements and the data requests can be transmitted normally.

[0059] Optionally, in the information processing apparatus provided in the embodiments of this application, the first processing unit 404 includes: a first setting module, used to set the target message task to enter a sleep state within a second preset time if the number of data requests within a first preset time is not greater than a preset value, wherein the second preset time is less than the first preset time.

[0060] Optionally, in the information processing apparatus provided in this application embodiment, the apparatus further includes: a second determining unit, configured to determine whether a target transaction lock exists in the account corresponding to the target message task before obtaining the number of data requests for the target message task if a target transaction lock exists in the account corresponding to the target message task; a first executing unit, configured to execute the data request for the target message task if a target transaction lock exists in the account corresponding to the target message task; and a third obtaining unit, configured to use the number of times the data request for the target message task is executed as the number of data requests.

[0061] Optionally, in the information processing apparatus provided in the embodiments of this application, the apparatus further includes: a second processing unit, configured to lock the account corresponding to the target message task based on the target instruction before executing the data request of the target message task if the account corresponding to the target message task has a target transaction lock, wherein the account corresponding to the target message task after the locking process has a target transaction lock.

[0062] Optionally, in the information processing apparatus provided in this application embodiment, the target name of the Redis corresponding to the target transaction lock includes the account of the target message task, and the target content of the Redis corresponding to the target transaction lock includes the timestamp when the target instruction is executed. After locking the account corresponding to the target message task based on the target transaction lock, the apparatus further includes: a third judgment unit, used to judge whether the effective time is greater than a third preset duration, wherein the effective time refers to the effective time of the account corresponding to the target message task after the locking process; a fourth judgment unit, used to judge whether the effective time is greater than a fourth preset duration based on the timestamp if the effective time is greater than the third preset duration; and a third processing unit, used to release the target transaction lock and delete the released target transaction lock if the effective time is greater than the fourth preset duration.

[0063] Optionally, in the information processing apparatus provided in this application embodiment, the first processing unit 404 includes: a first processing module, configured to unlock the account corresponding to the target message task based on the target transaction lock if the number of data requests within a first preset time period is not greater than a preset value; and a first release module, configured to release the target transaction lock of the account corresponding to the target message task after the account corresponding to the target message task has been unlocked.

[0064] The information processing device includes a processor and a memory. The first acquisition unit 401, the second acquisition unit 402, the first judgment unit 403, the first processing unit 404, etc., are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.

[0065] A processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and information processing is performed by adjusting kernel parameters.

[0066] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0067] This invention provides a storage medium on which a program is stored, which, when executed by a processor, implements an information processing method.

[0068] This invention provides a processor for running a program, wherein the program executes an information processing method during runtime.

[0069] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: reading a target message task from a message monitoring platform; if the account corresponding to the target message task has a target transaction lock, obtaining the number of data requests for the target message task; determining whether the number of data requests within a first preset time period is not greater than a preset value; if the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task.

[0070] When the processor executes the program, it also performs the following steps: if the number of data requests within the first preset duration is not greater than a preset value, the target message task is set to enter a sleep state within the second preset duration, wherein the second preset duration is less than the first preset duration.

[0071] When the processor executes the program, it also performs the following steps: if the account corresponding to the target message task has a target transaction lock, before obtaining the data request count of the target message task, it determines whether the target transaction lock exists in the account corresponding to the target message task; if the account corresponding to the target message task has a target transaction lock, it executes the data request of the target message task; and the number of times the data request of the target message task is executed is taken as the data request count.

[0072] When the processor executes the program, it also performs the following steps: if the account corresponding to the target message task has a target transaction lock, before executing the data request of the target message task, it performs locking processing on the account corresponding to the target message task based on the target instruction, wherein the account corresponding to the target message task has a target transaction lock after the locking processing.

[0073] When the processor executes the program, it also performs the following steps: the target name in Redis corresponding to the target transaction lock contains the account of the target message task, and the target content in Redis corresponding to the target transaction lock contains the timestamp when the target instruction is executed. After locking the account corresponding to the target message task based on the target transaction lock, it is determined whether the effective time is greater than the third preset duration, where the effective time refers to the effective time of the account corresponding to the target message task after the locking process. If the effective time is greater than the third preset duration, it is determined whether the effective time is greater than the fourth preset duration based on the timestamp. If the effective time is greater than the fourth preset duration, the target transaction lock is released and the released target transaction lock is deleted.

[0074] When the processor executes the program, it also performs the following steps: if the number of data requests within the first preset time period is not greater than a preset value, it unlocks the account corresponding to the target message task based on the target transaction lock; after the account corresponding to the target message task is unlocked, it releases the target transaction lock of the account corresponding to the target message task.

[0075] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0076] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: reading a target message task from a message monitoring platform; if the account corresponding to the target message task has a target transaction lock, obtaining the number of data requests for the target message task; determining whether the number of data requests within a first preset time period is not greater than a preset value; if the number of data requests within the first preset time period is not greater than the preset value, the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task.

[0077] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: if the number of data requests within a first preset duration is not greater than a preset value, set the target message task to enter a sleep state within a second preset duration, wherein the second preset duration is less than the first preset duration.

[0078] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: if the account corresponding to the target message task has a target transaction lock, then before obtaining the data request count of the target message task, determine whether the target transaction lock exists in the account corresponding to the target message task; if the account corresponding to the target message task has a target transaction lock, then execute the data request of the target message task; and use the number of times the data request of the target message task is executed as the data request count.

[0079] When executed on a data processing device, it is also suitable to execute a program with the following initialization steps: if the account corresponding to the target message task has a target transaction lock, then before executing the data request of the target message task, the account corresponding to the target message task is locked based on the target instruction, wherein the account corresponding to the target message task has a target transaction lock after the locking process.

[0080] When executed on a data processing device, it is also suitable to execute a program with the following initialization steps: the target name of the Redis corresponding to the target transaction lock contains the account of the target message task, the target content of the Redis corresponding to the target transaction lock contains the timestamp when the target instruction is executed, after locking the account corresponding to the target message task based on the target transaction lock, it is determined whether the effective time is greater than the third preset time, where the effective time refers to the effective time of the account corresponding to the target message task after the locking process; if the effective time is greater than the third preset time, it is determined whether the effective time is greater than the fourth preset time based on the timestamp; if the effective time is greater than the fourth preset time, the target transaction lock is released and the released target transaction lock is deleted.

[0081] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: if the number of data requests within a first preset time period is not greater than a preset value, unlock the account corresponding to the target message task based on the target transaction lock; after unlocking the account corresponding to the target message task, release the target transaction lock of the account corresponding to the target message task.

[0082] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0083] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0084] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0085] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0086] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0087] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0088] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0089] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0090] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0091] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. An information processing method, characterized in that, include: Read the target message task from the message monitoring platform; If the account corresponding to the target message task has a target transaction lock, then obtain the number of data requests for the target message task; Determine whether the number of data requests within the first preset time period is not greater than a preset value; If the number of data requests within the first preset time period is not greater than a preset value, the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task. If the account corresponding to the target message task has a target transaction lock, the method further includes the following steps before executing the data request for the target message task: Based on the target instruction, the account corresponding to the target message task is locked, wherein the account corresponding to the target message task after the locking process is subject to a target transaction lock. The target name in Redis corresponding to the target transaction lock contains the account of the target message task, and the target content in Redis corresponding to the target transaction lock contains the timestamp when the target instruction was executed; Determine whether the effective time is greater than the third preset duration, wherein the effective time refers to the effective time of the account corresponding to the target message task after the locking process; If the effective time is greater than the third preset duration, then determine whether the effective time is greater than the fourth preset duration based on the timestamp; If the effective time is greater than the fourth preset duration, release the target transaction lock and delete the released target transaction lock; Wherein, if the number of data requests within the first preset time period is not greater than a preset value, the target message task enters a dormant state, including: If the number of data requests within the first preset duration is not greater than a preset value, the target message task is set to enter a sleep state within the second preset duration, wherein the second preset duration is less than the first preset duration.

2. The method according to claim 1, characterized in that, If the account corresponding to the target message task has a target transaction lock, then before obtaining the data request count of the target message task, the method further includes: Determine whether the target transaction lock exists in the account corresponding to the target message task; If the account corresponding to the target message task has a target transaction lock, then execute the data request for the target message task; The number of times the data request for the target message task is executed is taken as the number of data requests.

3. The method according to claim 1, characterized in that, If the number of data requests within the first preset time period is not greater than a preset value, the target message task enters a dormant state, and the target transaction lock of the account corresponding to the target message task is released, including: If the number of data requests within the first preset time period is not greater than a preset value, the account corresponding to the target message task will be unlocked based on the target transaction lock. After the account corresponding to the target message task is unlocked, the target transaction lock of the account corresponding to the target message task is released.

4. An information processing device, characterized in that, include: The first acquisition unit is used to read the target message task from the message monitoring platform; The second acquisition unit is used to acquire the number of data requests for the target message task if the account corresponding to the target message task has a target transaction lock. The first judgment unit is used to determine whether the number of data requests within the first preset time period is not greater than a preset value; The first processing unit is configured to, if the number of data requests within a first preset time period is not greater than a preset value, then the target message task enters a dormant state and releases the target transaction lock of the account corresponding to the target message task. The device is further configured to lock the account corresponding to the target message task based on the target instruction, wherein the account corresponding to the target message task after locking is subject to a target transaction lock; the target name of the Redis corresponding to the target transaction lock contains the account of the target message task, and the target content of the Redis corresponding to the target transaction lock contains the timestamp when the target instruction was executed; determine whether the effective time is greater than a third preset duration, wherein the effective time refers to the effective time of the account corresponding to the target message task after locking; if the effective time is greater than the third preset duration, determine whether the effective time is greater than a fourth preset duration based on the timestamp; if the effective time is greater than the fourth preset duration, release the target transaction lock and delete the released target transaction lock; The first processing unit includes a first setting module, configured to set the target message task to enter a sleep state within a second preset time if the number of data requests within a first preset time is not greater than a preset value, wherein the second preset time is less than the first preset time.

5. A processor, characterized in that, The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 3 when it runs.

6. A storage medium, characterized in that, The storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Information processing method, device and system and readable storage medium

    CN110716794A

  • Distributed lock calling method and device, electronic equipment and storage medium

    CN112799791A