CN109977117A - The method and device that storage method, the data of status data are sent - Google Patents

The method and device that storage method, the data of status data are sent Download PDF

Info

Publication number
CN109977117A
CN109977117A CN201910204540.4A CN201910204540A CN109977117A CN 109977117 A CN109977117 A CN 109977117A CN 201910204540 A CN201910204540 A CN 201910204540A CN 109977117 A CN109977117 A CN 109977117A
Authority
CN
China
Prior art keywords
switch state
data
bitmap
user identifier
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910204540.4A
Other languages
Chinese (zh)
Inventor
林港健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Information Technology Co Ltd
Original Assignee
Guangzhou Huya Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Information Technology Co Ltd filed Critical Guangzhou Huya Information Technology Co Ltd
Priority to CN201910204540.4A priority Critical patent/CN109977117A/en
Publication of CN109977117A publication Critical patent/CN109977117A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This application discloses the method and devices that the storage method of status data, data are sent, wherein, the storage method of the status data includes: to obtain switch state data to be stored, and the switch state data include the target switch state and user identifier of user setting;The switch state data are stored using bitmap, wherein the offset of the bitmap is directed toward the user identifier, and the bit where the offset is for storing the target switch state.The memory space of switch state data can be greatly reduced in the present embodiment, and data volume is bigger, and the memory space effect of saving is more obvious.

Description

The method and device that storage method, the data of status data are sent
Technical field
The method and dress sent this application involves data processing field more particularly to the storage method of status data, data It sets.
Background technique
In the related art, the status datas such as user's switch are usually using the number such as String sentence of mysql or Redis It is stored according to inventory's storage structure, these storage organizations can be generated when storing to status data for a bar state data One storage record.Such as have 100,000,000 registration users, if being stored using mysql, it is desirable to which 100,000,000 records are used to store The switch state data for registering user, occupy a large amount of disk space.If storing opening for user using the String of Redis Off status data, 100,000,000 users are also required to the memory headroom of several GB to store, this makes inherently very deficient Redis memory At very big waste.
Summary of the invention
In view of this, the method and device that the application provides a kind of storage method of status data, data are sent.
According to the embodiment of the present application in a first aspect, providing a kind of storage method of status data, the method includes steps It is rapid:
Obtain switch state data to be stored, the switch state data include the target switch state of user setting with And user identifier;
The switch state data are stored using bitmap, wherein the offset of the bitmap is directed toward the user identifier, institute Bit where stating offset is used to store the target switch state.
In a kind of possible embodiment of the present embodiment, the switch state data further include application program identification, Before the switch state data using bitmap storage, further includes:
According to the application program identification, bitmap relevant to the application program identification is judged whether there is;
If it is not, then creating bitmap, and the bitmap of creation is associated with the application program identification.
In a kind of possible embodiment of the present embodiment, the method also includes:
According to the application program identification, the target switch state recorded in associated bitmap is summarized, is opened Summarize data in pass.
It is described to obtain switch state data to be stored in a kind of possible embodiment of the present embodiment, comprising:
The switch state data that application client is sent are received, the switch state data are the application program visitor Family end is after the switch setting operation for detecting user, according to the number of the target switch state and user identifier of acquisition generation According to.
It is described that the switch state data, packet are stored using bitmap in a kind of possible embodiment of the present embodiment It includes:
The switch state data are sent to third party's storage server, to be used by third party's storage server Bitmap stores the switch state data.
It is described that the switch state data, packet are stored using bitmap in a kind of possible embodiment of the present embodiment It includes:
The target switch state is converted into the first value or second value, and chooses an available bit from the bitmap Position stores first value or second value, wherein first value switches on state for describing;The second value is used for The closed state of switch is described;
The offset for the bit chosen is obtained, and the offset and the user identifier are associated.
According to the second aspect of the embodiment of the present application, a kind of method that data are sent is provided, which comprises
The registration user list of application program is obtained, the registration user list includes the user identifier of registered users;
Based on generated bitmap, the corresponding target switch state of each user identifier is determined;
Target data is sent to the user that the target switch state is open state.
It is described to be based on generated bitmap in a kind of possible embodiment of the present embodiment, determine each user identifier Corresponding target switch state, comprising:
Determine each user identifier associated target offset amount in the bitmap;
Read the numerical value stored in the bit where the target offset amount;
If the numerical value is the first value, determine that the corresponding target switch state of the user identifier is open state;
If the numerical value is second value, determine that the corresponding target switch state of the user identifier is in off state.
According to the third aspect of the embodiment of the present application, a kind of storage device of status data is provided, described device includes:
Switch state data acquisition module, for obtaining switch state data to be stored, the switch state data packet Include the target switch state and user identifier of user setting;
Switch state data memory module, for storing the switch state data using bitmap, wherein the bitmap Offset is directed toward the user identifier, and the bit where the offset is for storing the target switch state.
According to the fourth aspect of the embodiment of the present application, a kind of data sending device is provided, described device includes:
It registers user list and obtains module, for obtaining the registration user list of application program, the registration user list User identifier including registered users;
Switch state determining module determines the corresponding target switch shape of each user identifier for being based on generated bitmap State;
Data transmission blocks, for sending target data to the user that the target switch state is open state.
According to the 5th of the embodiment of the present application the aspect, a kind of computer readable storage medium is provided, calculating is stored thereon with Machine program, when described program is executed by processor the step of the realization above method.
According to the 6th of the embodiment of the present application aspect, a kind of terminal device is provided, including memory, processor and be stored in On memory and the computer program that can run on a processor, the processor realize the above method when executing described program Step.
Scheme provided by the present application has the following beneficial effects:
The present embodiment, come storage switch status data, takes full advantage of the attribute feature of bitmap itself, by position using bitmap The position offset of figure is directed toward user identifier, and the value of corresponding bit is as target switch state, and each switch state data Zhan Yiwei, the switch operation of user are all the bit manipulations to Bitmaps, and the storage for significantly reducing switch state data is empty Between, and data volume is bigger, the memory space effect of saving is more obvious.In a kind of illustrative experiment statistics, as registration user When amount is ten million data volume or more, the switch state data of the String storage user of traditional mysql table or redis are used When, the memory or disk storage space of GB rank are at least needed, and use the storage scheme of the present embodiment, it is only necessary to MB rank The memory headroom of (for example, more than ten MB).
In addition, lesser memory space is occupied since the present embodiment stores the switch state data of user using bitmap, Therefore the convenience to improve Data Migration when Data Migration, improve migration velocity.
Detailed description of the invention
Fig. 1 is a kind of step process of the storage method embodiment of status data shown in one exemplary embodiment of the application Figure;
Fig. 2 is the storage using Bitmaps storage multiple switch status data shown in one exemplary embodiment of the application Structural schematic diagram;
The step of Fig. 3 is the storage method embodiment of another status data shown in one exemplary embodiment of the application stream Cheng Tu;
The step of Fig. 4 is the storage method embodiment of another status data shown in one exemplary embodiment of the application stream Cheng Tu;
Fig. 5 is the step flow chart for the embodiment of the method that a kind of data shown in one exemplary embodiment of the application are sent;
Fig. 6 is a kind of hardware structure diagram of equipment where the device of the application;
Fig. 7 is a kind of structural frames of the memory device embodiment of status data shown in one exemplary embodiment of the application Figure;
Fig. 8 is a kind of structural block diagram of data sending device embodiment shown in one exemplary embodiment of the application.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the application.
It is only to be not intended to be limiting the application merely for for the purpose of describing particular embodiments in term used in this application. It is also intended in the application and the "an" of singular used in the attached claims, " described " and "the" including majority Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from In the case where the application range, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination ".
With reference to Fig. 1, a kind of storage method embodiment of status data shown in one exemplary embodiment of the application is shown Step flow chart, in one embodiment, this method can be applied in the background server of application program, specifically can wrap Include following steps:
Step 101, switch state data to be stored are obtained, the switch state data include that the target of user setting is opened Off status and user identifier.
As an example, switch state data can include but is not limited to the target switch state and use of user setting Family mark.Illustratively, target switch state may include the state that switches on or closed state.User identifier can wrap Include tourist's identity of the account that user registers in the application or account or user that user registers in terminal device Identity etc..
In another example, switch state data can also include application program identification, which is used for Which application program the corresponding switch of indicating on-off state data belongs to.
In a kind of possible embodiment of the present embodiment, step 101 may include following sub-step:
The switch state data that application client is sent are received, the switch state data are the application program visitor Family end is after the switch setting operation for detecting user, according to the number of the target switch state and user identifier of acquisition generation According to.
When realizing, application client can detecte user's opening to the switch of application in the setting page Setting operation is closed, and obtains the target switch state of the switch after executing switch setting operation, for example, if user, which opens, applies journey Some switch of sequence, then the target switch state of the switch is open state;If user closes some switch of application program, The target switch state of the switch is in off state.Meanwhile application client can also obtain user's login application program User identifier afterwards.Then switch state data are generated according to the target switch state and user identifier of the acquisition, and will opened Off status data, which are sent in background server, to be saved.
In a kind of example, if switch state data do not include application program identification, server can be according to using journey Sequence client closes the application program identification of the acquisition and switch state data to obtain corresponding application program identification Connection.
Step 102, the switch state data are stored using bitmap, wherein the offset of the bitmap is directed toward the use Family mark, the bit where the offset is for storing the target switch state.
In the present embodiment, it for the switch state data of acquisition, can be opened using storage organizations such as bitmaps to store this Off status data.The state of corresponding element is recorded using bit in bitmap, the offset of bitmap can be directed toward user's mark Know, the bit where the offset can be used to store target switch state.
In a kind of possible embodiment of the present embodiment, step 102 may include following sub-step:
The target switch state is converted to the first value or second value, and chooses one from the bitmap by sub-step S11 Available bit stores first value or second value, wherein first value switches on state for describing;It is described Second value is used to describe the closed state of switch;
For example, can will switch on state is set as the first value 1, the closed state of switch is set as second value 0.
In a kind of possible embodiment, it can be chosen since first available bit.For example, in bitmap In, it is assumed that the first two bit all recorded datas can then be chosen since third bit, choose third bit To record the first value or second value.
Sub-step S12, obtains the offset of the bit of selection, and by the offset and the user identifier into Row association.
Elected to take after recording the bit of the first value or second value, the bit of available selection is in bitmap Offset, and establish the incidence relation of the offset and user identifier.For example, it is assumed that the bit chosen is the in bitmap Three bits, offset 2 then can establish the incidence relation of offset 2 Yu user identifier.
Illustratively, above-mentioned bitmap can be Redis (Redis is key (key)-value (value) storage system) Bitmaps (bitmap).Wherein, Bitmaps is a kind of special " data structure ", substantially a character string, operating unit It is bit.One Bitmaps can be imagined as using position as unit array, each unit storage numerical value 0 in array or 1, it is marked in Bitmaps under array and is called offset.The maximum length of single Bitmaps is 512MB, i.e. 2^32 bit Position.
For example, the storage organization schematic diagram using Bitmaps storage multiple switch status data is shown in FIG. 2, In Fig. 2, the expression of numerical value 1 switches on state, and numerical value 0 indicates the closed state of switch.Then offset be respectively 1,2,6,9, 10, the switch state of 12,15,17,18,21,22,23 bit storage is open state, the corresponding bit of other offsets The switch state of position storage is in off state.
In a kind of example, it is assumed that the Bitmaps of storage switch status data is " user:switch ", and user identifier is 1542, then for the Redis order that some switch that user identifier is 1542 is open state to be arranged are as follows: " setbit user:switch 1542 1".When Bitmaps receives the order, then one available bit of selection is used to store numerical value 1, And generate the incidence relation of offset (for example, 2) and user identifier 1542 of the bit of the selection.
It should be noted that being readily applicable to other status numbers to the storage principle of switch state data in the present embodiment According to storage, for example, using bitmap record user whether access some webpage, and a day any active ues are calculated with this, the moon is actively used The data such as family, therefore the versatility of the storage scheme of the present embodiment is stronger.
The present embodiment, come storage switch status data, takes full advantage of the attribute feature of bitmap itself, by position using bitmap The position offset of figure is directed toward user identifier, and the value of corresponding bit is as target switch state, and each switch state data Zhan Yiwei, the switch operation of user are all the bit manipulations to Bitmaps, and the storage for significantly reducing switch state data is empty Between, and data volume is bigger, the memory space effect of saving is more obvious.In a kind of illustrative experiment statistics, as registration user When amount is ten million data volume or more, the switch state data of the String storage user of traditional mysql table or redis are used When, the memory or disk storage space of GB rank are at least needed, and use the storage scheme of the present embodiment, it is only necessary to MB rank The memory headroom of (for example, more than ten MB).
In addition, lesser memory space is occupied since the present embodiment stores the switch state data of user using bitmap, Therefore the convenience to improve Data Migration when Data Migration, improve migration velocity.
With reference to Fig. 3, the storage method for showing another status data shown in one exemplary embodiment of the application is implemented The step flow chart of example, in one embodiment, this method can be applied in the background server of application program, specifically can be with Include the following steps:
Step 201, switch state data to be stored are obtained.
As an example, switch state data can include but is not limited to the target switch state and use of user setting Family mark.Illustratively, target switch state may include the state that switches on or closed state.User identifier can wrap Include tourist's identity of the account that user registers in the application or account or user that user registers in terminal device Identity etc..
In another example, switch state data can also include application program identification, which is used for Which application program the corresponding switch of indicating on-off state data belongs to.
In a kind of possible embodiment of the present embodiment, step 201 may include following sub-step:
The switch state data that application client is sent are received, the switch state data are the application program visitor Family end is after the switch setting operation for detecting user, according to the number of the target switch state and user identifier of acquisition generation According to.
Step 202, according to the application program identification, position relevant to the application program identification is judged whether there is Figure;If it is not, thening follow the steps 203;If so, thening follow the steps 204.
Wherein, it also may include pacifying in equipment that the corresponding application program of application program identification, which may include system application, The third party application of dress, the present embodiment compare with no restriction.
In a kind of possible embodiment, the present embodiment can create corresponding bitmap for different application programs, The bitmap mark of each bitmap and the application program identification of the application program are associated.After determining application program identification, The whether related bitmap of the application program identification can be searched, if thening follow the steps 203 without associated bitmap.If Related bitmap thens follow the steps 204.
Step 203, bitmap is created, and the bitmap of creation is associated with the application program identification.
In one embodiment, it if bitmap is the Bitmaps of Redis, can be created using a series of static methods New Bitmap object, for example, can create Bitmaps by createBitmap method, the Bitmaps of creation has phase The bitmap mark answered, can establish the incidence relation of bitmap mark and application program identification.
Step 204, the switch state data are stored using bitmap, wherein the offset of the bitmap is directed toward the use Family mark, the bit where the offset is for storing the target switch state.
In a kind of possible embodiment of the present embodiment, step 204 may include following sub-step:
The target switch state is converted to the first value or second value, and chooses one from the bitmap by sub-step S21 Available bit stores first value or second value, wherein first value switches on state for describing;It is described Second value is used to describe the closed state of switch;
Sub-step S22, obtains the offset of the bit of selection, and by the offset and the user identifier into Row association.
Step 205, according to the application program identification, the target switch state recorded in associated bitmap is converged Always, it obtains switch and summarizes data.
The present embodiment records switch state data using the data structure of bitmap, can be in order to some application program Switch state is summarized, so that obtaining switch summarizes data.For example, in statistics application program some switch user open or Situation is closed, so as to optimize according to the data summarized to the switch, or executes other decisions, improves data remittance Total efficiency and accuracy.
With reference to Fig. 4, the storage method for showing another status data shown in one exemplary embodiment of the application is implemented The step flow chart of example, in one embodiment, this method can be applied in the background server of application program, specifically can be with Include the following steps:
Step 301, switch state data to be stored are obtained, the switch state data include that the target of user setting is opened Off status and user identifier.
In a kind of possible embodiment of the present embodiment, step 301 may include following sub-step:
The switch state data that application client is sent are received, the switch state data are the application program visitor Family end is after the switch setting operation for detecting user, according to the number of the target switch state and user identifier of acquisition generation According to.
Step 302, the switch state data are sent to third party's storage server, are taken with being stored by the third party Device be engaged in using the bitmap storage switch state data.
Fig. 4 embodiment and the difference of Fig. 1 or Fig. 3 embodiment be, Fig. 1 or Fig. 3 embodiment by background server directly into The storage of row switch state data.And after background server receives switch state data in Fig. 4 embodiment, by the switch shape State data are sent to third party's storage server to store, so as to preferably save the memory space of background server.
It is also using bitmap come storage switch status data for third party's storage server, it similarly, should The offset of bitmap is directed toward user identifier, and the bit where offset is for storing target switch state.
In a kind of possible embodiment, third party's storage server uses the mistake of bitmap storage switch status data Journey, comprising: target switch state is converted into the first value or second value, and chooses available bits position storage from the bitmap First value or second value, wherein first value switches on state for describing;The second value is opened for describing The off status of pass;The offset for the institute's rheme chosen is obtained, and the offset and the user identifier are associated.
In a kind of embodiment of extension, third party's storage server can also count the switch shape of multiple application programs State data, and the cluster that can be switched as unit of switching makes to provide the optimisation strategy etc. of certain type of switch Data more as far as possible can be stored with memory space small as far as possible by obtaining third party's storage server, and complete the mistake of big data analysis Journey improves the performance of third party's storage server.
With reference to Fig. 5, the step for the embodiment of the method that a kind of data shown in one exemplary embodiment of the application are sent is shown Rapid flow chart, in one embodiment, this method can be applied in the background server of application program, can specifically include as Lower step:
Step 401, the registration user list of application program is obtained, the registration user list includes the use of registered users Family mark;
In a kind of possible embodiment, acquisition can include from the database of the registration information of storage application program The registration user list of the user identifier of registered users.
Step 402, it is based on generated bitmap, determines the corresponding target switch state of each user identifier;
In one embodiment, the present embodiment can be adapted for the scene of message push, can be closed according to application The switch state data recorded in the bitmap of connection determine the mesh that assigned switch is arranged in each user identifier in registration user list Mark switch state.
In a kind of possible embodiment, step 402 may include following sub-step:
Sub-step S31 determines each user identifier associated target offset amount in the bitmap;
Sub-step S32 reads the numerical value stored in the bit where the target offset amount;
Sub-step S33 determines that the corresponding target switch state of the user identifier is to open if the numerical value is the first value Open state;
Sub-step S34 determines the corresponding target switch state of the user identifier if the numerical value is second value to close Closed state.
In a kind of example, bitmap can be the Bitmaps (bitmap) of Redis.Assuming that storage switch status data Bitmaps is " user:switch ", user identifier 1542, then being used to obtain some switch that user identifier is 1542 The Redis order of target switch state are as follows: " getbit user:switch 1542 ".When Bitmaps receives the order, then User identifier 1542 is searched first from the incidence relation of the offset of the bit of the Bitmaps and user identifier, to obtain It obtains and the associated target offset amount of user identifier 1542, it is assumed that be offset 2.Then it reads in the bit that offset is 2 and remembers The numerical value of record, if the numerical value is the first value, then it represents that corresponding target switch state is open state.If the numerical value is second Value, then it represents that corresponding target switch state is in off state.
Step 403, Xiang Suoshu target switch state is that the user of open state sends target data.
In one embodiment, it is the user of open state for target switch state, indicates pushing away for the user setting Sending switch is open state, can push target data to the user.For the user that target switch state is in off state, table Show that the push switch of the user setting is in off state, does not then push target data to the user.
The present embodiment can determine the corresponding mesh of each user identifier in the registration user list of application program according to bitmap Switch state is marked, then target data is pushed to the user that target switch state is open state, simplifies the reading of switch state Process is taken, the efficiency of data-pushing is improved.
Corresponding with the embodiment of preceding method, present invention also provides the memory device embodiment of status data and numbers According to sending device embodiment.
The Installation practice of the application can be applied on electronic equipment (such as server).Installation practice can pass through Software realization can also be realized by way of hardware or software and hardware combining.Taking software implementation as an example, it anticipates as a logic Device in justice is to be read computer program instructions corresponding in nonvolatile memory by the processor of equipment where it Into memory, operation is formed.For hardware view, as shown in fig. 6, for a kind of hardware of equipment where the device of the application Structure chart, other than processor shown in fig. 6, memory, network interface and nonvolatile memory, device in embodiment The equipment at place can also include other hardware, repeat no more to this generally according to the actual functional capability of the device.
Referring to FIG. 7, the storage device for showing a kind of status data shown in one exemplary embodiment of the application is implemented The structural block diagram of example, described device includes following module:
Switch state data acquisition module 501, for obtaining switch state data to be stored, the switch state data Target switch state and user identifier including user setting;
Switch state data memory module 502, for storing the switch state data using bitmap, wherein institute's rheme The offset of figure is directed toward the user identifier, and the bit where the offset is for storing the target switch state.
In a kind of possible embodiment of the application, the switch state data further include application program identification, institute Stating device can also include following module:
Bitmap judgment module, for judging whether there is and the application program identification according to the application program identification Relevant bitmap;If it is not, then calling bitmap creation module;
Bitmap creation module is closed for creating bitmap, and by the bitmap of creation with the application program identification Connection.
In a kind of possible embodiment of the application, described device can also include following module:
Summarizing module, for according to the application program identification, to the target switch state recorded in associated bitmap into Row summarizes, and obtains switch and summarizes data.
In a kind of possible embodiment of the application, the switch state data acquisition module 501 includes following son Module:
Switch state data receiver submodule, it is described for receiving the switch state data of application client transmission Switch state data are the application client after the switch setting operation for detecting user, are opened according to the target of acquisition The data that off status and user identifier generate.
In a kind of possible embodiment of the application, the switch state data memory module 502 is specifically used for:
The switch state data are sent to third party's storage server, to be used by third party's storage server Bitmap stores the switch state data.
In a kind of possible embodiment of the application, the switch state data memory module 502 includes following son Module:
Sub-module stored, for the target switch state to be converted to the first value or second value, and from the bitmap It chooses an available bit and stores first value or second value, wherein first value switches on shape for describing State;The second value is used to describe the closed state of switch;
Offset is associated with submodule, the offset of the bit for obtaining selection, and by the offset and institute User identifier is stated to be associated.
Referring to FIG. 8, showing a kind of knot of data sending device embodiment shown in one exemplary embodiment of the application Structure block diagram, described device include following module:
It registers user list and obtains module 601, for obtaining the registration user list of application program, the registration user column Table includes the user identifier of registered users;
Switch state determining module 602 determines the corresponding target switch of each user identifier for being based on generated bitmap State;
Data transmission blocks 603, for sending target data to the user that the target switch state is open state.
In a kind of possible embodiment of the application, the switch state determining module 602 may include following son Module:
Target offset amount determines submodule, for determining each user identifier associated target offset amount in the bitmap;
Bit reading submodule, for reading the numerical value stored in the bit where the target offset amount;If institute Stating numerical value is the first value, then determines that the corresponding target switch state of the user identifier is open state;If the numerical value is the Two-value then determines that the corresponding target switch state of the user identifier is in off state.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member It is physically separated with being or may not be, component shown as a unit may or may not be physics list Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of the modules realize the purpose of application scheme.Those of ordinary skill in the art are not paying creative labor In the case where dynamic, it can understand and implement.
Present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, described program quilt The step of above method embodiment is realized when processor executes.
Present invention also provides a kind of terminal device, including memory, processor and storage on a memory and can located The step of computer program run on reason device, the processor realizes above method embodiment when executing described program.
Theme described in this specification and the embodiment of feature operation can be realized in the following: Fundamental Digital Circuit, Computer software or firmware, the computer including structure disclosed in this specification and its structural equivalents of tangible embodiment are hard The combination of part or one or more of which.The embodiment of theme described in this specification can be implemented as one or Multiple computer programs, i.e. coding are executed by data processing equipment on tangible non-transitory program carrier or are controlled at data Manage one or more modules in the computer program instructions of the operation of device.Alternatively, or in addition, program instruction can be with It is coded on manually generated transmitting signal, such as electricity, light or electromagnetic signal that machine generates, the signal are generated will believe Breath encodes and is transferred to suitable receiver apparatus to be executed by data processing equipment.Computer storage medium can be machine can Read storage equipment, machine readable storage substrate, random or serial access memory equipment or one or more of which group It closes.
Processing described in this specification and logic flow can by execute one of one or more computer programs or Multiple programmable calculators execute, to execute corresponding function by the way that output is operated and generated according to input data.Institute It states processing and logic flow can also be by dedicated logic circuit-such as FPGA (field programmable gate array) or ASIC (dedicated collection At circuit) Lai Zhihang, and device also can be implemented as dedicated logic circuit.
The computer for being suitable for carrying out computer program includes, for example, general and/or special microprocessor or it is any its The central processing unit of his type.In general, central processing unit will refer to from read-only memory and/or random access memory reception Order and data.The basic module of computer includes central processing unit for being practiced or carried out instruction and for storing instruction With one or more memory devices of data.In general, computer will also be including one or more great Rong for storing data Amount storage equipment, such as disk, magneto-optic disk or CD etc. or computer will be coupled operationally with this mass-memory unit To receive from it data or have both at the same time to its transmission data or two kinds of situations.However, computer is not required to have in this way Equipment.In addition, computer can be embedded in another equipment, such as car-mounted terminal, mobile phone, personal digital assistant (PDA), Mobile audio frequency or video player, game console, global positioning system (GPS) receiver or such as general serial The portable memory apparatus of bus (USB) flash drive, names just a few.
It is suitable for storing computer program instructions and the computer-readable medium of data including the non-volatile of form of ownership Memory, medium and memory devices, for example including semiconductor memory devices (such as EPROM, EEPROM and flash memory device), Disk (such as internal hard drive or removable disk), magneto-optic disk and CD ROM and DVD-ROM disk.Processor and memory can be by special It is supplemented or is incorporated in dedicated logic circuit with logic circuit.
Although this specification includes many specific implementation details, these are not necessarily to be construed as the model for limiting any invention It encloses or range claimed, and is primarily used for describing the feature of the specific embodiment of specific invention.In this specification Certain features described in multiple embodiments can also be combined implementation in a single embodiment.On the other hand, individually implementing Various features described in example can also be performed separately in various embodiments or be implemented with any suitable sub-portfolio.This Outside, although feature can work in certain combinations as described above and even initially so be claimed, institute is come from One or more features in claimed combination can be removed from the combination in some cases, and claimed Combination can be directed toward the modification of sub-portfolio or sub-portfolio.
Similarly, although depicting operation in the accompanying drawings with particular order, this is understood not to require these behaviour Make the particular order shown in execute or sequentially carry out or require the operation of all illustrations to be performed, to realize desired knot Fruit.In some cases, multitask and parallel processing may be advantageous.In addition, the various system modules in above-described embodiment Separation with component is understood not to be required to such separation in all embodiments, and it is to be understood that described Program assembly and system can be usually integrated in together in single software product, or be packaged into multiple software product.
The specific embodiment of theme has been described as a result,.Other embodiments are within the scope of the appended claims.? In some cases, the movement recorded in claims can be executed in different order and still realize desired result.This Outside, the processing described in attached drawing and it is nonessential shown in particular order or sequential order, to realize desired result.In certain realities In existing, multitask and parallel processing be may be advantageous.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.

Claims (12)

1. a kind of storage method of status data, which is characterized in that the described method includes:
Switch state data to be stored are obtained, the switch state data include the target switch state and use of user setting Family mark;
The switch state data are stored using bitmap, wherein the offset of the bitmap is directed toward the user identifier, described inclined Bit where shifting amount is for storing the target switch state.
2. the method according to claim 1, wherein the switch state data further include application program identification, Before the switch state data using bitmap storage, further includes:
According to the application program identification, bitmap relevant to the application program identification is judged whether there is;
If it is not, then creating bitmap, and the bitmap of creation is associated with the application program identification.
3. according to the method described in claim 2, it is characterized by further comprising:
According to the application program identification, the target switch state recorded in associated bitmap is summarized, switch is obtained and converges Total data.
4. method according to claim 1-3, which is characterized in that described to obtain switch state number to be stored According to, comprising:
The switch state data that application client is sent are received, the switch state data are the application client After the switch setting operation for detecting user, according to the data of the target switch state and user identifier of acquisition generation.
5. method according to claim 1-3, which is characterized in that described to store the switch state using bitmap Data, comprising:
The switch state data are sent to third party's storage server, to use bitmap by third party's storage server Store the switch state data.
6. method according to claim 1-3, which is characterized in that described to store the switch state using bitmap Data, comprising:
The target switch state is converted into the first value or second value, and chooses an available bit from the bitmap and deposits Store up first value or second value, wherein first value switches on state for describing;The second value is for describing The closed state of switch;
The offset for the bit chosen is obtained, and the offset and the user identifier are associated.
7. a kind of method that data are sent, which is characterized in that the described method includes:
The registration user list of application program is obtained, the registration user list includes the user identifier of registered users;
Based on generated bitmap, the corresponding target switch state of each user identifier is determined;
Target data is sent to the user that the target switch state is open state.
8. determining each user identifier the method according to the description of claim 7 is characterized in that described be based on generated bitmap Corresponding target switch state, comprising:
Determine each user identifier associated target offset amount in the bitmap;
Read the numerical value stored in the bit where the target offset amount;
If the numerical value is the first value, determine that the corresponding target switch state of the user identifier is open state;
If the numerical value is second value, determine that the corresponding target switch state of the user identifier is in off state.
9. a kind of storage device of status data, which is characterized in that described device includes:
Switch state data acquisition module, for obtaining switch state data to be stored, the switch state data include using The target switch state and user identifier of family setting;
Switch state data memory module, for storing the switch state data using bitmap, wherein the offset of the bitmap Amount is directed toward the user identifier, and the bit where the offset is for storing the target switch state.
10. a kind of data sending device, which is characterized in that described device includes:
It registers user list and obtains module, for obtaining the registration user list of application program, the registration user list includes The user identifier of registered users;
Switch state determining module determines the corresponding target switch state of each user identifier for being based on generated bitmap;
Data transmission blocks, for sending target data to the user that the target switch state is open state.
11. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed The step of any one of claim 1-6 and/or 7-8 the method is realized when device executes.
12. a kind of terminal device including memory, processor and stores the calculating that can be run on a memory and on a processor Machine program, which is characterized in that the processor realizes any one of claim 1-6 and/or 7-8 side when executing described program The step of method.
CN201910204540.4A 2019-03-18 2019-03-18 The method and device that storage method, the data of status data are sent Pending CN109977117A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910204540.4A CN109977117A (en) 2019-03-18 2019-03-18 The method and device that storage method, the data of status data are sent

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910204540.4A CN109977117A (en) 2019-03-18 2019-03-18 The method and device that storage method, the data of status data are sent

Publications (1)

Publication Number Publication Date
CN109977117A true CN109977117A (en) 2019-07-05

Family

ID=67079322

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910204540.4A Pending CN109977117A (en) 2019-03-18 2019-03-18 The method and device that storage method, the data of status data are sent

Country Status (1)

Country Link
CN (1) CN109977117A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113449141A (en) * 2021-06-08 2021-09-28 阿波罗智联(北京)科技有限公司 Voice broadcasting method and device, electronic equipment and storage medium
CN113760915A (en) * 2021-09-07 2021-12-07 百果园技术(新加坡)有限公司 Data processing method, device, equipment and medium
CN114138138A (en) * 2022-01-30 2022-03-04 北京金堤科技有限公司 Operation feedback method and device based on bitmap, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104793897A (en) * 2015-02-04 2015-07-22 北京神州云科数据技术有限公司 Bitmap storage method
CN106844662A (en) * 2017-01-23 2017-06-13 北京奇虎科技有限公司 The recording method of instant message read state and device
US9842117B1 (en) * 2014-12-29 2017-12-12 EMC IP Holding Company LLC Managing replication of file systems
CN108415952A (en) * 2018-02-02 2018-08-17 北京腾云天下科技有限公司 User data storage method, label computational methods and computing device
CN109428924A (en) * 2017-08-29 2019-03-05 阿里巴巴集团控股有限公司 Presence maintaining method, access layer assembly, application system and the equipment of application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9842117B1 (en) * 2014-12-29 2017-12-12 EMC IP Holding Company LLC Managing replication of file systems
CN104793897A (en) * 2015-02-04 2015-07-22 北京神州云科数据技术有限公司 Bitmap storage method
CN106844662A (en) * 2017-01-23 2017-06-13 北京奇虎科技有限公司 The recording method of instant message read state and device
CN109428924A (en) * 2017-08-29 2019-03-05 阿里巴巴集团控股有限公司 Presence maintaining method, access layer assembly, application system and the equipment of application
CN108415952A (en) * 2018-02-02 2018-08-17 北京腾云天下科技有限公司 User data storage method, label computational methods and computing device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHJX922: "redis中bitmap的妙用", 《SEGMENTFAULT》 *
琦彦: "redis:bitmaps使用场景-用户签到、统计活跃用户、用户在线状态", 《CSDN》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113449141A (en) * 2021-06-08 2021-09-28 阿波罗智联(北京)科技有限公司 Voice broadcasting method and device, electronic equipment and storage medium
CN113760915A (en) * 2021-09-07 2021-12-07 百果园技术(新加坡)有限公司 Data processing method, device, equipment and medium
CN114138138A (en) * 2022-01-30 2022-03-04 北京金堤科技有限公司 Operation feedback method and device based on bitmap, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN107453896B (en) Method and device for processing multiple block chain network data and server
CN109977117A (en) The method and device that storage method, the data of status data are sent
CN107610695A (en) Driver's voice wakes up the dynamic adjusting method of instruction word weight
CN106802885A (en) A kind of meeting summary automatic record method, device and electronic equipment
CN110457912A (en) Data processing method, device and electronic equipment
CN105988896B (en) The backup method and device of a kind of mobile terminal data
FI127117B (en) Image processors and computer programs
CN107864405B (en) Viewing behavior type prediction method, device and computer readable medium
CN107077507A (en) A kind of information-pushing method, device and system
CN106686105A (en) Method of pushing messages, computing device, server and information sharing system
CN110365811A (en) A kind of MAC address learning method for limiting, device and equipment
US9451423B2 (en) Method and apparatus for recording information during a call
CN110175081A (en) A kind of optimization system and its method played for Android audio
CN109451537A (en) Network shunt method and relevant device
CN106788993A (en) A kind of encryption communication method, device and electronic equipment
CN108694035A (en) The report management method and device of voice messaging
CN103631975A (en) Data extraction method and device
CN107623721A (en) 3D Touch function menus generation methods and device
US20230229896A1 (en) Method and computing device for determining optimal parameter
CN106034119B (en) Method and device is obscured in the encryption of application installation package
CN105610698B (en) The treating method and apparatus of event result
CN107609065A (en) One kind game classification method, apparatus and electronic equipment
CN106850999A (en) A kind of music playlist storage processing method and system based on mobile terminal
CN104978981B (en) A kind of music shuffle method and device
CN107968812A (en) The method and device of synchronous local resource and Internet resources

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190705

RJ01 Rejection of invention patent application after publication