Calendar data storage method, device, computer equipment and storage medium

By analyzing and converting calendar data, and determining the offset based on the day identification and total number of days for segmentation storage, the problem of calendar data occupies a lot of memory in traditional technology is solved, and resource saving is achieved.

CN113806359BActive Publication Date: 2024-11-01SHENZHEN YUNZHIJIA NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110719460.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2024-11-01
Estimated Expiration
2041-06-28

AI Technical Summary

Technical Problem

In traditional technology, calendar data storage occupies a lot of memory in the server, resulting in wasted storage resources.

Method used

By obtaining the original calendar data for each day of the target month sent by the terminal, parsing it into point marking data, converting it into calendar metadata for completed and unfinished states, and determining the offset based on the day mark and total days, the completed state is completed The data of the bitmap structure is stored in the completed section, and the data in the unfinished state is stored in the unfinished section.

Benefits of technology

It greatly reduces the memory usage of calendar data and saves a lot of storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113806359B_ABST
    Figure CN113806359B_ABST
Patent Text Reader

Abstract

The present application relates to a calendar data storage method, device, computer equipment and storage medium. The method comprises: obtaining the original calendar data corresponding to each day in the target month sent by the terminal; parsing the original calendar data to obtain the point marking data corresponding to each day in the target month; converting the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month; determining the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month; according to the offset, storing the calendar metadata of the completed state in the completed segment of the pre-constructed bitmap structure space in the cache, and storing the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space. The use of this method can save storage resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a calendar data storage method, device, computer equipment and storage medium. Background Art

[0002] With the development of computer technology, many time management applications have emerged, such as time assistants. Based on time management applications, users can manage their schedules, meetings, task schedules, etc. These time management applications generate a lot of calendar data every day. In traditional technologies, calendar data is usually stored directly in the server, which takes up a lot of memory and causes a waste of storage resources. Summary of the invention

[0003] Based on this, it is necessary to provide a calendar data storage method, device, computer equipment and storage medium that can save storage resources in order to solve the above technical problems.

[0004] A calendar data storage method, the method comprising:

[0005] Obtaining the original calendar data corresponding to each day of the target month sent by the terminal;

[0006] Parsing the original calendar data to obtain point marking data corresponding to each day in the target month;

[0007] Converting the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month;

[0008] Determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month;

[0009] According to the offset, the calendar metadata in the completed state is stored in the completed segment of the bitmap structure space pre-constructed in the cache, and the calendar metadata in the unfinished state is stored in the unfinished segment of the bitmap structure space.

[0010] A calendar data storage device, the device comprising:

[0011] A first acquisition module is used to acquire original calendar data corresponding to each day of the target month sent by the terminal;

[0012] A parsing module, used to parse the original calendar data to obtain point marking data corresponding to each day in the target month;

[0013] A conversion module, used for converting the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month;

[0014] A determination module, configured to determine an offset corresponding to each day in the target month according to a day identifier of each day in the target month and the total number of days in the target month;

[0015] A storage module is used to store the calendar metadata in the completed state into the completed segment of the bitmap structure space pre-constructed in the cache according to the offset, and store the calendar metadata in the unfinished state into the unfinished segment of the bitmap structure space.

[0016] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0017] Obtaining the original calendar data corresponding to each day of the target month sent by the terminal;

[0018] Parsing the original calendar data to obtain point marking data corresponding to each day in the target month;

[0019] Converting the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month;

[0020] Determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month;

[0021] According to the offset, the calendar metadata in the completed state is stored in the completed segment of the bitmap structure space pre-constructed in the cache, and the calendar metadata in the unfinished state is stored in the unfinished segment of the bitmap structure space.

[0022] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0023] Obtaining the original calendar data corresponding to each day of the target month sent by the terminal;

[0024] Parsing the original calendar data to obtain point marking data corresponding to each day in the target month;

[0025] Converting the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month;

[0026] Determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month;

[0027] According to the offset, the calendar metadata in the completed state is stored in the completed segment of the bitmap structure space pre-constructed in the cache, and the calendar metadata in the unfinished state is stored in the unfinished segment of the bitmap structure space.

[0028] The above-mentioned calendar data storage method, device, computer equipment and storage medium obtain the original calendar data corresponding to each day in the target month sent by the terminal; parse the original calendar data to obtain the point marking data corresponding to each day in the target month; convert the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month; determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month; according to the offset, store the calendar metadata of the completed state in the completed segment of the pre-constructed bitmap structure space in the cache, and store the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space. In this way, by parsing the original calendar data into the corresponding point marking data, and then by converting the point marking data into the corresponding calendar metadata, and storing the calendar metadata in segments according to the offset determined based on the day number identifier and the total number of days in the target month, the memory occupation of the calendar data is greatly reduced, thereby saving a lot of storage resources.

[0029] A calendar data storage method, the method comprising:

[0030] Get the original calendar data corresponding to each day in the target month;

[0031] The original calendar data is sent to a server to instruct the server to parse the original calendar data to obtain point marking data corresponding to each day in the target month, and the point marking data is converted into calendar metadata of a completed state and calendar metadata of an unfinished state corresponding to each day in the target month; according to the day identifier of each day in the target month and the total number of days in the target month, the offset corresponding to each day in the target month is determined; according to the offset, the calendar metadata of the completed state is stored in the completed segment of the bitmap structure space pre-constructed in the cache, and the calendar metadata of the unfinished state is stored in the unfinished segment of the bitmap structure space.

[0032] A calendar data storage device, the device comprising:

[0033] The second acquisition module is used to acquire the original calendar data corresponding to each day in the target month;

[0034] A sending module is used to send the original calendar data to a server to instruct the server to parse the original calendar data to obtain point marking data corresponding to each day in the target month, convert the point marking data into calendar metadata of a completed state and calendar metadata of an unfinished state corresponding to each day in the target month, determine the offset corresponding to each day in the target month according to the day identifier of each day in the target month and the total number of days in the target month, and store the calendar metadata of the completed state in the completed segment of a bitmap structure space pre-constructed in a cache according to the offset, and store the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space.

[0035] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0036] Get the original calendar data corresponding to each day in the target month;

[0037] The original calendar data is sent to a server to instruct the server to parse the original calendar data to obtain point marking data corresponding to each day in the target month, and the point marking data is converted into calendar metadata of a completed state and calendar metadata of an unfinished state corresponding to each day in the target month; according to the day identifier of each day in the target month and the total number of days in the target month, the offset corresponding to each day in the target month is determined; according to the offset, the calendar metadata of the completed state is stored in the completed segment of the bitmap structure space pre-constructed in the cache, and the calendar metadata of the unfinished state is stored in the unfinished segment of the bitmap structure space.

[0038] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0039] Get the original calendar data corresponding to each day in the target month;

[0040] The original calendar data is sent to a server to instruct the server to parse the original calendar data to obtain point marking data corresponding to each day in the target month, and the point marking data is converted into calendar metadata of a completed state and calendar metadata of an unfinished state corresponding to each day in the target month; according to the day identifier of each day in the target month and the total number of days in the target month, the offset corresponding to each day in the target month is determined; according to the offset, the calendar metadata of the completed state is stored in the completed segment of the bitmap structure space pre-constructed in the cache, and the calendar metadata of the unfinished state is stored in the unfinished segment of the bitmap structure space.

[0041] The calendar data storage method, device, computer equipment and storage medium obtain the original calendar data corresponding to each day in the target month; send the original calendar data to the server to instruct the server to parse the original calendar data, obtain the point marking data corresponding to each day in the target month, convert the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month, determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month, store the calendar metadata of the completed state in the completed segment of the pre-constructed bitmap structure space in the cache according to the offset, and store the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space. In this way, by parsing the original calendar data into the corresponding point marking data, and then by converting the point marking data into the corresponding calendar metadata, and storing the calendar metadata in segments according to the offset determined based on the day number identifier and the total number of days in the target month, the memory occupation of the calendar data is greatly reduced, thereby saving a lot of storage resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is an application scenario diagram of a calendar data storage method in one embodiment;

[0043] Figure 2 A schematic diagram of a flow chart of a calendar data storage method in one embodiment;

[0044] Figure 3 This is a schematic diagram of calendar data storage methods using traditional technology;

[0045] Figure 4 A schematic diagram of calendar metadata storage of the present application in one embodiment;

[0046] Figure 5 A flowchart of a calendar data storage method in another embodiment;

[0047] Figure 6 A schematic diagram of a process of obtaining calendar data in one embodiment;

[0048] Figure 7 A schematic diagram of the timing of obtaining calendar data in one embodiment;

[0049] Figure 8 is a structural block diagram of a calendar data storage device in one embodiment;

[0050] Fig. 9 is a structural block diagram of a calendar data storage device in another embodiment;

[0051] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] The calendar data storage method provided by this application can be applied to Figure 1 In the application environment shown. The application environment includes a terminal 102 and a server 104. The terminal 102 communicates with the server 104 through a network. The terminal 102 may specifically include a desktop terminal or a mobile terminal. The mobile terminal may specifically include at least one of a mobile phone, a tablet computer, and a laptop computer. The server 104 may be implemented as an independent server or a server cluster composed of multiple servers. Those skilled in the art will understand that Figure 1 The application environment shown in is only a part of the scenarios related to the present application solution and does not constitute a limitation on the application environment of the present application solution.

[0054] The server 104 can obtain the original calendar data corresponding to each day of the target month sent by the terminal 102, parse the original calendar data, obtain the point marking data corresponding to each day of the target month, convert the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day of the target month, determine the offset corresponding to each day of the target month according to the day number identifier of each day in the target month and the total number of days in the target month, and store the calendar metadata of the completed state in the completed segment of the bitmap structure space pre-constructed in the cache according to the offset, and store the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space.

[0055] In one embodiment, Figure 2 As shown, a calendar data storage method is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:

[0056] S202, obtaining original calendar data corresponding to each day of the target month sent by the terminal.

[0057] The target month refers to the month for which the user needs to set the calendar. The original calendar data is the calendar data obtained based on the calendar setting operation of the user, and the original calendar data may include at least one of schedules, meetings, tasks, and memos.

[0058] Specifically, a time assistant is running on the terminal, and the user can input the original calendar data corresponding to each day of the target month based on the time assistant. The terminal can obtain the original calendar data corresponding to each day of the target month input by the user, and send the original calendar data corresponding to each day of the target month to the server. The server can receive the original calendar data corresponding to each day of the target month sent by the terminal. Among them, the time assistant is an application for managing time.

[0059] S204, parsing the original calendar data to obtain point marking data corresponding to each day in the target month.

[0060] The dot marking data is the marking data on the calendar view of the time assistant that is used to characterize the completion status of each day's schedule tasks, wherein the completion status may include a completed state and an uncompleted state. For example, the dot marking data may include a red dot, a green dot, and a check mark. A red dot may be used to indicate that a schedule task is in an overdue uncompleted state, a green dot may be used to indicate that a schedule task is in a normal uncompleted state, and a check mark may be used to indicate that a schedule task is in a completed state.

[0061] Specifically, the server may parse the original calendar data corresponding to each day in the target month one by one to obtain the point marking data corresponding to each day in the target month.

[0062] S206: Convert the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month.

[0063] Among them, calendar metadata is binary data used to indicate the completion status of a schedule task, and is used to indicate the "true" and "false" of an event. Calendar metadata in the completed state is calendar metadata used to indicate whether a schedule task is truly completed. Calendar metadata in the uncompleted state is calendar metadata used to indicate whether a schedule task is truly uncompleted. For example, if the calendar metadata in the completed state is "1", it indicates that the schedule task is "truly" completed, that is, the schedule task is completed. If the calendar metadata in the completed state is "0", it indicates that the schedule task is "falsely" completed, that is, the schedule task is not completed. If the calendar metadata in the uncompleted state is "1", it indicates that the schedule task is "truly" uncompleted, that is, the schedule task is not completed. If the calendar metadata in the uncompleted state is "0", it indicates that the schedule task is "falsely" uncompleted, that is, the schedule task is completed.

[0064] Specifically, each day in the target month may correspond to calendar metadata of a completed state and calendar metadata of an uncompleted state. The server may convert the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month.

[0065] S208, determining the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month.

[0066] The day number identifier is the date of each day in the target month. For example, if the target month is May, the day number identifier of May 24 in May is 24. The offset is the distance that the storage unit in the bitmap structure space is offset within the data structure segment.

[0067] Specifically, the server can determine the day number identifier of each day in the target month and the total number of days in the target month. Further, the server can determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month.

[0068] S210, according to the offset, storing the calendar metadata in the completed state into the completed segment of the bitmap structure space pre-constructed in the cache, and storing the calendar metadata in the unfinished state into the unfinished segment of the bitmap structure space.

[0069] The completed segment is a data structure segment in the bitmap structure space used to store calendar metadata in a completed state, and the unfinished segment is a data structure segment in the bitmap structure space used to store calendar metadata in an unfinished state.

[0070] Specifically, the bitmap structure space may include a completed segment and an unfinished segment. The server may store the calendar metadata in the completed state into the completed segment of the pre-built bitmap structure space in the cache and store the calendar metadata in the unfinished state into the unfinished segment of the bitmap structure space according to the offset.

[0071] In the above calendar data storage method, the original calendar data corresponding to each day in the target month sent by the terminal is obtained; the original calendar data is parsed to obtain the point marking data corresponding to each day in the target month; the point marking data is converted into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month; the offset corresponding to each day in the target month is determined according to the day number identifier of each day in the target month and the total number of days in the target month; according to the offset, the calendar metadata of the completed state is stored in the completed segment of the pre-constructed bitmap structure space in the cache, and the calendar metadata of the unfinished state is stored in the unfinished segment of the bitmap structure space. In this way, by parsing the original calendar data into the corresponding point marking data, and then by converting the point marking data into the corresponding calendar metadata, and storing the calendar metadata in segments according to the offset determined based on the day number identifier and the total number of days in the target month, the memory occupation of the calendar data is greatly reduced, thereby saving a lot of storage resources.

[0072] like Figure 3 As shown, the key is the date, and the value is the calendar metadata corresponding to each day of a month. In traditional technology, the user ID (Identity document) can usually be used as an offset to store calendar data. However, using the user ID as an offset is only convenient when the user ID is an integer. When the user ID is of other types, such as a character type, it is necessary to pre-process the user ID by compression or mapping, which results in a high storage cost for calendar data. In this application, the offset corresponding to each day in the target month is determined based on the day identifier of each day in the target month and the total number of days in the target month. The implementation is simple and greatly reduces the storage cost of calendar data.

[0073] At the same time, by using the user ID as an offset, the user ID can directly determine the size of the space for the bitmap structure, which results in a large amount of memory being consumed for calendar data storage, thereby causing a waste of storage resources. However, the present application determines the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month, and each month has a maximum of 31 days, so the calendar data is stored in segments, and a total of 62 calendar metadata only require 64 bits to satisfy, which greatly reduces the memory usage of calendar data, thereby saving a large amount of storage resources.

[0074] In one embodiment, the offset includes a completed offset and an unfinished offset. Step S210, that is, according to the offset, storing the calendar metadata in a completed state in a completed segment of a bitmap structure space pre-constructed in the cache, and storing the calendar metadata in an unfinished state in an unfinished segment of the bitmap structure space, specifically includes: according to the completed offset, storing the calendar metadata in a completed state in a completed segment of a bitmap structure space pre-constructed in the cache, and according to the unfinished offset, storing the calendar metadata in an unfinished state in an unfinished segment of the bitmap structure space.

[0075] The completed offset is the offset distance of the storage unit of the completed segment in the bitmap structure space within the data structure segment. The unfinished offset is the offset distance of the storage unit of the unfinished segment in the bitmap structure space within the data structure segment.

[0076] Specifically, it can be understood that based on the completed offset, the server can determine the target storage location of the calendar metadata in the completed state in the completed segment. Based on the unfinished offset, the server can determine the target storage location of the calendar metadata in the unfinished segment. The server can store the calendar metadata in the completed state in the completed segment of the pre-built bitmap structure space in the cache according to the completed offset, and store the calendar metadata in the unfinished state in the unfinished segment of the bitmap structure space according to the unfinished offset.

[0077] In the above embodiment, the calendar metadata of the completed state and the unfinished state are stored in the completed segment and the unfinished segment of the pre-constructed bitmap structure space in the cache according to the completed offset and the unfinished offset, respectively, so that the calendar data storage efficiency can be improved.

[0078] In one embodiment, the step of calculating the completed offset includes: performing a modulo operation on the day number identifier of each day in the target month and the total number of days in the target month to obtain the completed offset corresponding to each day in the target month. The step of calculating the uncompleted offset includes: performing a sum operation on the completed offset and the preset target number of days to obtain the uncompleted offset corresponding to each day in the target month.

[0079] Specifically, the server may perform a modulo operation on the day number identifier of each day in the target month and the total number of days in the target month to obtain the completed offset corresponding to each day in the target month. Furthermore, the server may perform a sum operation on the completed offset and the preset target number of days to obtain the uncompleted offset corresponding to each day in the target month.

[0080] For example, the calendar metadata storage diagram is as follows: Figure 4 As shown, the total number of days in this month is 31 days. The calendar data of a month with 31 days only needs 64 bits of 8 bytes of storage space to meet the storage requirements, where 1 byte consists of 8 bits. The key is the day number identifier, that is, Figure 4 The subscripts in the table are 1 to 31. The value is the corresponding calendar metadata, i.e. Figure 4 If the target month is May and the total number of days in May is 31, the completed offset (completed offset) on May 24 can be expressed as 24%31, and the uncompleted offset (uncompleted offset) on May 24 can be expressed as 24%31+31. "%" represents the modulo operation.

[0081] In the above embodiment, the completed offset can be quickly obtained by performing a modulo operation on the day number identifier of each day in the target month and the total number of days in the target month. And the completed offset and the preset target number of days are summed to quickly obtain the corresponding uncompleted offset, thereby improving the calculation efficiency.

[0082] In one embodiment, the above-mentioned calendar data storage method specifically also includes: receiving a data acquisition request sent by a terminal, the data acquisition request including a preset display date of a calendar view; in response to the data acquisition request, searching from a cache for calendar metadata of a target completed state and calendar metadata of a target uncompleted state that correspond to the display date and are within a validity period; if found, determining the target point marking data corresponding to the display date based on the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state; if not found, acquiring the target original calendar data corresponding to the display date from a database, and converting the target original calendar data into target point marking data corresponding to the display date; and sending the target point marking data to the terminal to instruct the terminal to display the target point marking data based on the calendar view.

[0083] The display date of the calendar view refers to the date within the preset display days on the calendar view. For example, if the calendar view is set to display 2 weeks by default, that is, 14 days, the display date of the calendar view is from the current day (such as May 1st) to May 14th.

[0084] Specifically, the terminal may generate a data acquisition request in response to a user trigger operation, and send the data acquisition request to the server. The server may receive the data acquisition request sent by the terminal, wherein the data acquisition request includes a preset display date of the calendar view, and the calendar metadata is also preset with an effective period in the cache. In response to the data acquisition request, the server may search the cache for calendar metadata of the target completed state and calendar metadata of the target uncompleted state that correspond to the display date and are within the effective period. If found, the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state are bitwise operated to determine the target point marking data corresponding to the display date. If not found, the target original calendar data corresponding to the display date is obtained from the database, the target original calendar data is converted into the target point marking data corresponding to the display date, and the target point marking data is sent to the terminal. The terminal may receive the point marking data sent by the server, and display the target point marking data based on the calendar view.

[0085] Optionally, the calculation priority of the calendar metadata of the target uncompleted state is higher than the calculation priority of the calendar metadata of the target completed state. The server can determine the target point marking data corresponding to the display date based on the corresponding calculation priorities of the calendar metadata of the target uncompleted state and the calendar metadata of the target completed state. For example, if the calendar metadata of the target uncompleted state corresponding to May 24 is "1", then regardless of whether the corresponding calendar metadata of the target completed state is "1" or "0", the target point marking data corresponding to May 24 is in the uncompleted state. If the calendar metadata of the target uncompleted state corresponding to May 24 is "0", the corresponding calendar metadata of the target completed state is "1", and the target point marking data corresponding to May 24 is in the completed state.

[0086] In the above embodiment, when the terminal requests calendar data from the server, it first searches the cache to see if there is calendar metadata that meets the requirements. If so, the calendar metadata can be directly converted into corresponding point marking data. If not, it is necessary to obtain the corresponding original calendar data from the database and convert the original calendar data into corresponding point marking data. In this way, the efficiency of obtaining calendar data of the terminal can be improved.

[0087] In one embodiment, if not found, after the step of obtaining the target original calendar data corresponding to the display date from the database, the above-mentioned calendar data storage method specifically also includes: converting the target original calendar data into the corresponding calendar metadata of the target completed state and the calendar metadata of the target uncompleted state; asynchronously writing the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state into the cache.

[0088] Specifically, the server can convert the target original calendar data into corresponding calendar metadata of the target completed state and calendar metadata of the target uncompleted state, and determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month. According to the offset, the calendar metadata of the completed state is stored in the completed segment of the pre-constructed bitmap structure space in the cache, and the calendar metadata of the uncompleted state is stored in the uncompleted segment of the bitmap structure space.

[0089] In the above embodiment, calendar metadata in the target completed state and calendar metadata in the target uncompleted state are asynchronously written into the cache, and calendar data that meets the conditions is prepared for the next round of data request, thereby improving the efficiency of the terminal in acquiring calendar data.

[0090] In one embodiment, Figure 5 As shown, a calendar data storage method is provided, which is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:

[0091] S502: Obtain original calendar data corresponding to each day in the target month.

[0092] Specifically, a time assistant is running on the terminal, and the user can input the original calendar data corresponding to each day in the target month based on the time assistant, and the terminal can obtain the original calendar data corresponding to each day in the target month input by the user.

[0093] S504, sending the original calendar data to the server to instruct the server to parse the original calendar data, obtain the point marking data corresponding to each day in the target month, convert the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month, determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month, and store the calendar metadata of the completed state in the completed segment of the bitmap structure space pre-constructed in the cache according to the offset, and store the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space.

[0094] Specifically, the terminal may send the original calendar data corresponding to each day of the target month to the server. The server may receive the original calendar data corresponding to each day of the target month sent by the terminal. Among them, the time assistant is an application for managing time. The server may parse the original calendar data corresponding to each day of the target month one by one to obtain the point marking data corresponding to each day of the target month. Each day in the target month may correspond to the calendar metadata of the completed state and the calendar metadata of the unfinished state. The server may convert the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day of the target month. The server may determine the day number identifier of each day in the target month in the target month, and the total number of days in the target month. Furthermore, the server may determine the offset corresponding to each day in the target month based on the day number identifier of each day in the target month in the target month and the total number of days in the target month. The bitmap structure space may include completed segments and unfinished segments. The server may store the calendar metadata in the completed state into the completed segment of the bitmap structure space pre-built in the cache, and store the calendar metadata in the unfinished state into the unfinished segment of the bitmap structure space according to the offset.

[0095] In the above embodiment, the original calendar data corresponding to each day in the target month is obtained; the original calendar data is sent to the server to instruct the server to parse the original calendar data, and the point marking data corresponding to each day in the target month is obtained, and the point marking data is converted into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month. According to the day number identifier of each day in the target month and the total number of days in the target month, the offset corresponding to each day in the target month is determined, and according to the offset, the calendar metadata of the completed state is stored in the completed segment of the pre-constructed bitmap structure space in the cache, and the calendar metadata of the unfinished state is stored in the unfinished segment of the bitmap structure space. In this way, by parsing the original calendar data into the corresponding point marking data, and then by converting the point marking data into the corresponding calendar metadata, and storing the calendar metadata in segments according to the offset determined based on the day number identifier and the total number of days in the target month, the memory occupation of the calendar data is greatly reduced, thereby saving a lot of storage resources.

[0096] In one embodiment, the above-mentioned calendar data storage method specifically also includes: generating a data acquisition request in response to a user trigger operation, the data acquisition request including a preset display date of the calendar view; sending the data acquisition request to the server to instruct the server to search from the cache for calendar metadata of the target completed state and calendar metadata of the target incomplete state that correspond to the display date and are within the validity period in response to the data acquisition request; if found, determining the target point marking data corresponding to the display date based on the calendar metadata of the target completed state and the calendar metadata of the target incomplete state; if not found, obtaining the target original calendar data corresponding to the display date from the database, and converting the target original calendar data into the target point marking data corresponding to the display date; receiving and displaying the target point marking data sent by the server.

[0097] Specifically, the terminal may generate a data acquisition request in response to a user trigger operation, and send the data acquisition request to the server. The server may receive the data acquisition request sent by the terminal, wherein the data acquisition request includes a preset display date of the calendar view, and the calendar metadata is also preset with an effective period in the cache. In response to the data acquisition request, the server may search the cache for calendar metadata of the target completed state and calendar metadata of the target uncompleted state that correspond to the display date and are within the effective period. If found, the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state are bitwise operated to determine the target point marking data corresponding to the display date. If not found, the target original calendar data corresponding to the display date is obtained from the database, the target original calendar data is converted into the target point marking data corresponding to the display date, and the target point marking data is sent to the terminal. The terminal may receive the point marking data sent by the server, and display the target point marking data based on the calendar view.

[0098] In the above embodiment, when the terminal requests calendar data from the server, it first searches the cache to see if there is calendar metadata that meets the requirements. If so, the calendar metadata can be directly converted into corresponding point marking data. If not, it is necessary to obtain the corresponding original calendar data from the database and convert the original calendar data into corresponding point marking data. In this way, the efficiency of obtaining calendar data of the terminal can be improved.

[0099] In one embodiment, Figure 6 and Figure 7As shown, the terminal can send a data acquisition request to the server through the time assistant. After receiving the data acquisition request, the server can search for the corresponding calendar metadata in the Redis cache. If found, it determines whether the calendar metadata needs to be preloaded (it can be understood that if the calendar data processing is within the validity period, that is, the preloading threshold is not triggered, then preloading is not required; if it is not within the validity period, that is, the preloading threshold is triggered, then preloading is required). If preloading is not required, the calendar metadata is directly parsed, and the parsed calendar metadata is converted into point marking data to be sent to the terminal for display. If not found or preloading is required, the original calendar data is asynchronously obtained from the Mongo database, and the original calendar data is converted into point marking data to be sent to the terminal for display. At the same time, the original calendar data is converted into calendar metadata and asynchronously updated to the Redis cache to prepare data for the next request.

[0100] It should be understood that although Figure 2 and Figure 5 The steps are shown in order, but they are not necessarily executed in order. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Figure 2 and Figure 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0101] In one embodiment, Figure 8 As shown, a calendar data storage device 800 is provided, comprising: a first acquisition module 801, a parsing module 802, a conversion module 803, a determination module 804 and a storage module 805, wherein:

[0102] The first acquisition module 801 is used to acquire the original calendar data corresponding to each day in the target month sent by the terminal.

[0103] The parsing module 802 is used to parse the original calendar data to obtain the point marking data corresponding to each day in the target month.

[0104] The conversion module 803 is used to convert the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month.

[0105] The determination module 804 is used to determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month.

[0106] The storage module 805 is used to store the calendar metadata in the completed state into the completed segment of the bitmap structure space pre-built in the cache according to the offset, and store the calendar metadata in the unfinished state into the unfinished segment of the bitmap structure space.

[0107] In one embodiment, the storage module 805 is also used to store the calendar metadata in a completed state in a completed segment of a bitmap structure space pre-built in the cache according to the completed offset, and to store the calendar metadata in an unfinished state in an unfinished segment of the bitmap structure space according to the unfinished offset.

[0108] In one embodiment, the determination module 804 is further configured to perform a modulo operation on the day number identifier of each day in the target month and the total number of days in the target month to obtain the completed offset corresponding to each day in the target month. The completed offset is summed with the preset target number of days to obtain the uncompleted offset corresponding to each day in the target month.

[0109] In one embodiment, the calendar data storage device 800 also includes a first search module, which is used to receive a data acquisition request sent by the terminal, and the data acquisition request includes a preset display date of the calendar view; in response to the data acquisition request, search the cache for calendar metadata of the target completed state and calendar metadata of the target uncompleted state that correspond to the display date and are within the validity period; if found, determine the target point marking data corresponding to the display date based on the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state; if not found, obtain the target original calendar data corresponding to the display date from the database, and convert the target original calendar data into target point marking data corresponding to the display date; send the target point marking data to the terminal to instruct the terminal to display the target point marking data based on the calendar view.

[0110] In one embodiment, the first search module is also used to convert the target original calendar data into corresponding calendar metadata of the target completed state and calendar metadata of the target uncompleted state; and asynchronously write the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state into the cache.

[0111] The above-mentioned calendar data storage device obtains the original calendar data corresponding to each day in the target month sent by the terminal; parses the original calendar data to obtain the point marking data corresponding to each day in the target month; converts the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month; determines the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month; according to the offset, stores the calendar metadata of the completed state in the completed segment of the bitmap structure space pre-constructed in the cache, and stores the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space. In this way, by parsing the original calendar data into the corresponding point marking data, and then by converting the point marking data into the corresponding calendar metadata, and storing the calendar metadata in segments according to the offset determined based on the day number identifier and the total number of days in the target month, the memory occupation of the calendar data is greatly reduced, thereby saving a lot of storage resources.

[0112] In one embodiment, Fig. 9 As shown, a calendar data storage device 900 is provided, comprising: a second acquisition module 901 and a sending module 902, wherein:

[0113] The second acquisition module 901 is used to acquire the original calendar data corresponding to each day in the target month.

[0114] The sending module 902 is used to send the original calendar data to the server to instruct the server to parse the original calendar data, obtain the point marking data corresponding to each day in the target month, convert the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month, determine the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month, and store the calendar metadata of the completed state in the completed segment of the bitmap structure space pre-constructed in the cache according to the offset, and store the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space.

[0115] In one embodiment, the calendar data storage device 900 also includes a second search module, which is used to generate a data acquisition request in response to a user trigger operation, and the data acquisition request includes a preset display date of the calendar view; send the data acquisition request to the server to instruct the server to respond to the data acquisition request and search from the cache for calendar metadata of the target completed state and calendar metadata of the target uncompleted state that correspond to the display date and are within the validity period; if found, determine the target point marking data corresponding to the display date based on the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state; if not found, obtain the target original calendar data corresponding to the display date from the database, and convert the target original calendar data into the target point marking data corresponding to the display date; receive and display the target point marking data sent by the server.

[0116] The calendar data storage device acquires the original calendar data corresponding to each day in the target month; sends the original calendar data to the server to instruct the server to parse the original calendar data, obtains the point marking data corresponding to each day in the target month, converts the point marking data into the calendar metadata of the completed state and the calendar metadata of the unfinished state corresponding to each day in the target month, determines the offset corresponding to each day in the target month according to the day number identifier of each day in the target month and the total number of days in the target month, stores the calendar metadata of the completed state in the completed segment of the pre-constructed bitmap structure space in the cache according to the offset, and stores the calendar metadata of the unfinished state in the unfinished segment of the bitmap structure space. In this way, by parsing the original calendar data into the corresponding point marking data, and then by converting the point marking data into the corresponding calendar metadata, and storing the calendar metadata in segments according to the offset determined based on the day number identifier and the total number of days in the target month, the memory occupation of the calendar data is greatly reduced, thereby saving a lot of storage resources.

[0117] For the specific definition of the calendar data storage device, please refer to the definition of the calendar data storage method above, which will not be repeated here. Each module in the above-mentioned calendar data storage device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0118] In one embodiment, a computer device is provided, which may be the above-mentioned Figure 1 The internal structure diagram of the server 104 in FIG. 1 may be as follows: Fig.10As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store calendar data storage data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a calendar data storage method is implemented.

[0119] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0120] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the calendar data storage method described above. The steps of the calendar data storage method here may be the steps of the calendar data storage method described in the above embodiments.

[0121] In one embodiment, a computer readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the calendar data storage method described above. The steps of the calendar data storage method here may be the steps of the calendar data storage method described in the above embodiments.

[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0124] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A calendar data storage method, characterized in that: The method comprises: Obtaining the original calendar data corresponding to each day of the target month sent by the terminal; Parsing the original calendar data to obtain point marking data corresponding to each day in the target month; Converting the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month; Performing a modulo operation on the day number identifier of each day in the target month and the total number of days in the target month to obtain the completed offset corresponding to each day in the target month, and performing a sum operation on the completed offset and the preset target number of days to obtain the uncompleted offset corresponding to each day in the target month; According to the completed offset, the calendar metadata in the completed state is stored in the completed segment of the bitmap structure space pre-built in the cache, and, according to the unfinished offset, the calendar metadata in the unfinished state is stored in the unfinished segment of the bitmap structure space.

2. The method according to claim 1, characterized in that The method further comprises: Receiving a data acquisition request sent by a terminal, wherein the data acquisition request includes a preset display date of a calendar view; In response to the data acquisition request, searching from the cache for calendar metadata of a target completed state and calendar metadata of a target not completed state that are within a validity period and correspond to the display date; If found, determining the target point marking data corresponding to the displayed date according to the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state; If not found, obtaining the target original calendar data corresponding to the display date from the database, and converting the target original calendar data into the target point marking data corresponding to the display date; The target point marking data is sent to the terminal to instruct the terminal to display the target point marking data based on the calendar view.

3. The method according to claim 2, characterized in that If the target original calendar data corresponding to the display date is not found, the method further comprises: Converting the target original calendar data into corresponding calendar metadata of a target completed state and calendar metadata of a target uncompleted state; The calendar metadata of the target completed state and the calendar metadata of the target uncompleted state are asynchronously written into the cache.

4. A calendar data storage method, characterized in that: The method comprises: Get the original calendar data corresponding to each day in the target month; The original calendar data is sent to a server to instruct the server to parse the original calendar data to obtain point marking data corresponding to each day in the target month, the point marking data is converted into calendar metadata of a completed state and calendar metadata of an unfinished state corresponding to each day in the target month, a modulo operation is performed on the day number identifier of each day in the target month and the total number of days in the target month to obtain a completed offset corresponding to each day in the target month, and the completed offset is summed with a preset target number of days to obtain an unfinished offset corresponding to each day in the target month; according to the completed offset, the calendar metadata of the completed state is stored in a completed segment of a bitmap structure space pre-constructed in a cache, and, according to the unfinished offset, the calendar metadata of the unfinished state is stored in an unfinished segment of the bitmap structure space.

5. The method according to claim 4, characterized in that The method further comprises: In response to a user trigger operation, generating a data acquisition request, wherein the data acquisition request includes a preset display date of the calendar view; The data acquisition request is sent to a server to instruct the server to respond to the data acquisition request and search from a cache for calendar metadata of a target completed state and calendar metadata of a target uncompleted state that correspond to the display date and are within a validity period; if found, the target point marking data corresponding to the display date is determined based on the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state; if not found, the target original calendar data corresponding to the display date is obtained from a database, and the target original calendar data is converted into the target point marking data corresponding to the display date; Receive and display the target point marking data sent by the server.

6. A calendar data storage device, characterized in that: The device comprises: A first acquisition module is used to acquire original calendar data corresponding to each day of the target month sent by the terminal; A parsing module, used to parse the original calendar data to obtain point marking data corresponding to each day in the target month; A conversion module, used for converting the point marking data into calendar metadata of a completed state and calendar metadata of an uncompleted state corresponding to each day in the target month; a determination module, configured to perform a modulo operation on the day number identifier of each day in the target month and the total number of days in the target month to obtain a completed offset corresponding to each day in the target month, and to sum the completed offset and a preset target number of days to obtain an uncompleted offset corresponding to each day in the target month; A storage module is used to store the calendar metadata in the completed state into the completed segment of the bitmap structure space pre-constructed in the cache according to the completed offset, and to store the calendar metadata in the unfinished state into the unfinished segment of the bitmap structure space according to the unfinished offset.

7. The device according to claim 6, characterized in that The device also includes: A first search module, configured to receive a data acquisition request sent by a terminal, wherein the data acquisition request includes a preset display date of a calendar view; The first search module is further used to respond to the data acquisition request and search from the cache for calendar metadata of the target completed state and calendar metadata of the target uncompleted state that correspond to the display date and are within the validity period; The first search module is further configured to determine the target point marking data corresponding to the display date according to the calendar metadata of the target completed state and the calendar metadata of the target uncompleted state if the target point marking data is found; The first search module is further configured to obtain the target original calendar data corresponding to the display date from the database if the target date is not found, and convert the target original calendar data into the target point marking data corresponding to the display date; The first search module is further configured to send the target point marking data to the terminal to instruct the terminal to display the target point marking data based on the calendar view.

8. A calendar data storage device, characterized in that: The device comprises: The second acquisition module is used to acquire the original calendar data corresponding to each day in the target month; A sending module is used to send the original calendar data to a server to instruct the server to parse the original calendar data to obtain point marking data corresponding to each day in the target month, convert the point marking data into calendar metadata of a completed state and calendar metadata of an unfinished state corresponding to each day in the target month, perform a modulo operation on the day number identifier of each day in the target month and the total number of days in the target month to obtain a completed offset corresponding to each day in the target month, and sum the completed offset with a preset target number of days to obtain an unfinished offset corresponding to each day in the target month; store the calendar metadata of the completed state in a completed segment of a bitmap structure space pre-constructed in a cache according to the completed offset, and store the calendar metadata of the unfinished state in an unfinished segment of the bitmap structure space according to the unfinished offset.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.