CN117520007A - Cache synchronization method and system based on Saas system - Google Patents

Cache synchronization method and system based on Saas system Download PDF

Info

Publication number
CN117520007A
CN117520007A CN202311422890.0A CN202311422890A CN117520007A CN 117520007 A CN117520007 A CN 117520007A CN 202311422890 A CN202311422890 A CN 202311422890A CN 117520007 A CN117520007 A CN 117520007A
Authority
CN
China
Prior art keywords
counting
information
abnormal
micro
reloading
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
CN202311422890.0A
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.)
Suzhou Pushsoft Co ltd
Original Assignee
Suzhou Pushsoft 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 Suzhou Pushsoft Co ltd filed Critical Suzhou Pushsoft Co ltd
Priority to CN202311422890.0A priority Critical patent/CN117520007A/en
Publication of CN117520007A publication Critical patent/CN117520007A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The application relates to a cache synchronization method and system based on a Saas system, which relate to the technical field of cache counting and comprise the following steps: performing a resin cache count to obtain a first count value, wherein the first count value is the number of unclear information; if the first count value is abnormal, generating abnormal clear data, wherein the abnormal clear data comprises n pieces of first clear information, and n is more than or equal to 1; reading the content of n pieces of first clear information, and marking the first clear information with the same content as first abnormal information, wherein the first abnormal information corresponds to m micro servers, and m is more than or equal to 1; the micro server which firstly checks the first clear information in the m micro servers is used as a local micro server, the local micro server counts and reloads the abnormal clear data, and after the local micro server counts and reloads, a second count value generated after the counting and reloading is obtained, so that the accuracy of Redis cache counting in a Saas scene is improved.

Description

Cache synchronization method and system based on Saas system
Technical Field
The application relates to the technical field of cache counting, in particular to a cache synchronization method and system based on a Saas system.
Background
In Saas program development, we often use dis to cache counts for fast counting operations and knowledge of the unclear information data. To ensure consistency of cached data, we will typically have the micro server access the same Redis service.
With respect to the related art in the above, the present application finds the following problems: in the micro server scene, two different micro servers can respond to the request, and the two micro servers cannot be mutually locked, so when one uses the same account number and respectively views a certain article at different micro servers, the phenomenon that the number of unclear information is reduced by two is likely to occur, and the Redis cache count is inaccurate.
Disclosure of Invention
In order to improve the accuracy of Redis cache counting in a Saas scene, the application provides a cache synchronization method and system based on a Saas system.
In a first aspect, the present application provides a buffer synchronization method based on a Saas system, which adopts the following technical scheme:
a cache synchronization method based on a Saas system specifically comprises the following steps:
performing a resin cache count to obtain a first count value, and judging whether the first count value is abnormal, wherein the first count value is the number of unclear information;
if the first count value is abnormal, generating abnormal clear data, wherein the abnormal clear data comprises n pieces of first clear information, each piece of first clear information corresponds to one micro server, n is a natural number, and n is more than or equal to 1;
reading the content of n pieces of first clear information, and marking the first clear information with the same content as first abnormal information, wherein the first abnormal information corresponds to m micro servers, m is a natural number, and m is more than or equal to 1;
taking the micro server which firstly looks over the first clear information in the m micro servers as a local micro server, counting and reloading the abnormal clear data through the local micro server, and prohibiting other micro servers from counting and reloading;
after the local micro server finishes counting reloading, the prohibition of other micro servers is released, and a second count value generated after counting reloading is obtained.
By adopting the technical scheme, firstly, carrying out the resin cache counting, judging whether the obtained first count value is abnormal, wherein the first count value is the quantity of uncleaned information, if so, generating abnormal cleaned data, wherein the abnormal cleaned data comprises n pieces of first cleaned information, each piece of first cleaned information corresponds to one micro server, n is a natural number and is more than or equal to 1, then, reading the content of the n pieces of first cleaned information, marking the first cleaned information with the same content as the first abnormal information, the first abnormal information corresponds to m micro servers, m is a natural number, m is more than or equal to 1, finally, taking the micro server which firstly checks the first cleaned information in the m micro servers as a local micro server, carrying out counting heavy load on the abnormal cleaned data through the local micro server, prohibiting the counting heavy load on other micro servers, and releasing the prohibition on the heavy load on the other micro servers after the local micro servers is carried out heavy load, and obtaining the second count value after the second count value is generated.
In the counting reloading process, the local micro-server prohibits other micro-servers from carrying out counting reloading to avoid the phenomenon that the number of the unclean information data is reduced by two when people use the same account number in different micro-servers to check a certain article at the same time, thereby improving the accuracy of Redis cache counting in a Saas scene.
Optionally, the performing a resin cache count specifically includes the following steps:
acquiring a preset relational database, wherein the relational database comprises information total data, and the information total data comprises the unclean information and the clean information;
and performing Redis cache counting on the total information data.
By adopting the technical scheme, the information total data which changes in real time in the preset relational database is obtained, and Redis cache counting is carried out on the information total data in real time, so that the accuracy of the information total data is guaranteed.
Optionally, a buffer synchronization method based on the Saas system further includes the following steps:
in the relational database, if the number of the uncleaned information is reduced by a plurality of pieces, the number of the uncleaned information is correspondingly increased by a plurality of pieces, and if the number of the uncleaned information is increased by a plurality of pieces, the number of the uncleaned information is kept unchanged.
By adopting the technical scheme, the increasing and decreasing relation between the unclear information and the clear information is clarified.
Optionally, before the obtaining the relational database, the method further includes the following steps:
and creating a unique key value, wherein the unique key value is used for marking the number of the micro servers corresponding to the cleared information, recording the starting time of counting reloads and recording the related information of the micro servers carrying out the counting reloads.
By adopting the technical scheme, the unique key value for marking the number of the micro servers corresponding to the cleared information, recording the starting time for counting and reloading and recording the related information of the micro servers for counting and reloading is created.
Optionally, the counting reloads specifically includes the following steps:
counting all the first clear information with the same content as only one first clear information, and carrying out reckoning on the abnormal clear data to obtain normal clear data;
and according to the normal clear data, re-performing Redis cache counting on the total information data in the relational database.
By adopting the technical scheme, the Redis cache count is carried out on the total information data again by carrying out the count reload.
Optionally, the counting reload further includes setting a local detection interval time, and after the determining whether the Resid buffer count is abnormal, the method further includes the following steps:
when the time reaches the set local detection interval time, judging whether counting reload is carried out in the local detection interval time;
if the counting reload is carried out in the local detection interval time, local detection is not needed, the time for counting reload last time in the local detection interval time is obtained, and the remaining time for carrying out next local detection is calculated according to the local detection interval time from the time for counting reload last time;
if the counting reload is not carried out within the local detection interval time, local detection is needed.
By adopting the technical scheme, firstly, when the time reaches the set local detection interval time, judging whether the counting reloading is carried out in the local detection interval time, then, if the counting reloading is carried out in the local detection interval time, the counting reloading is not needed, the time for carrying out the counting reloading last time in the local detection interval time is obtained, the remaining time for carrying out the next local detection is calculated according to the local detection interval time from the time for carrying out the counting reloading last time, the local detection is ended, and if the counting reloading is not carried out in the local detection interval time, the counting reloading is needed.
The local detection is set, so that the statistics and updating of the total information data of which the quantity is continuously changed in the relational database can be facilitated within a certain time, the good running state love of Redis cache counting is ensured, and the phenomenon of unordered accumulation of data is avoided.
Optionally, after the local detection is required, the method specifically includes the following steps:
in the relational database, counting and reloading the cleared information, and prohibiting other micro servers from counting and reloading;
after the counting reloading is completed, the prohibition of other micro servers is released, and a third counting value generated after the counting reloading is obtained.
By adopting the technical scheme, the local detection is carried out after the local detection is required.
In a second aspect, the cache synchronization system based on the Saas system provided in the present application adopts the following technical scheme:
a cache synchronization system based on a Saas system comprises an execution module, an abnormality judgment module, an abnormal data generation module, an abnormality reading module and a counting reload module;
the execution module is used for executing the resin cache counting to obtain a first count value, wherein the first count value is the quantity of unclear information, and the execution module is electrically connected with the abnormality judgment module, the abnormality data generation module, the abnormality reading module and the counting reload module;
the abnormality determination module is used for determining whether the first count value is abnormal;
the abnormal data generation module is used for generating abnormal cleaned data when the first count value is abnormal, the abnormal cleaned data comprises n pieces of first cleaned information, each piece of first cleaned information corresponds to one micro server, n is a natural number, and n is more than or equal to 1;
the anomaly reading module is used for reading the content of n pieces of first clear information, and marking the first clear information with the same content as first anomaly information, wherein the first anomaly information corresponds to m micro servers, m is a natural number, and m is more than or equal to 1;
the counting reloading module is used for taking a micro server which firstly looks at the first cleared information in the m micro servers as a local micro server, counting and reloading the abnormal cleared data through the local micro server, and prohibiting other micro servers from counting and reloading;
the counting reloading module is also used for releasing the prohibition of other micro servers after the local micro server finishes counting reloading, and obtaining a second counting value generated after the counting reloading.
By adopting the technical scheme, firstly, the execution module performs the resin cache counting, the abnormality judgment module judges whether the first count value obtained by the resin cache counting is abnormal, if so, the abnormality data generation module generates abnormality cleaned data, the abnormality cleaned data comprises n pieces of first cleaned information, each piece of first cleaned information corresponds to one micro server, n is a natural number and is more than or equal to 1, then, the abnormality reading module reads the content of the n pieces of first cleaned information, marks the first cleaned information with the same content as first abnormality information, finally, the counting reloading module takes the micro server which firstly checks the first cleaned information in the m micro servers as a local micro server, counts and reloads the abnormality cleaned data through the local micro server, inhibits the other micro servers from counting and reloads, releases the inhibition of the other micro servers after the local micro server counts, acquires the first abnormal information and generates a second count value after the local micro server counts.
In a third aspect, the present application further provides an intelligent terminal, which adopts the following technical scheme:
an intelligent terminal comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the computer program realizes the cache synchronization method based on the Saas system when being executed by the processor.
In a fourth aspect, the present application further provides a computer readable storage medium, which adopts the following technical scheme:
a computer readable storage medium comprising a readable storage medium and a computer program stored for execution on the readable storage medium, the computer program loaded and executed by a processor to implement the Saas system based cache synchronization method.
In summary, the present application includes at least one of the following beneficial technical effects:
1. in the counting reloading process, the local micro-server prohibits other micro-servers from carrying out counting reloading to avoid the phenomenon that the number of the unclean information data is reduced by two when people use the same account number and check one article in different micro-servers at the same time, thereby improving the accuracy of Redis cache counting in a Saas scene;
2. performing Redis cache counting on the information total data in real time, and ensuring the accuracy of the information total data;
3. the local detection is set, so that the statistics and updating of the total information data of which the quantity is continuously changed in the relational database can be facilitated within a certain time, the good running state love of Redis cache counting is ensured, and the phenomenon of unordered accumulation of data is avoided.
Drawings
FIG. 1 is a schematic diagram of the overall structure of a Saas system-based cache synchronization system according to an embodiment of the present application;
FIG. 2 is a schematic overall flow chart of a cache synchronization method based on a Saas system in an embodiment of the present application;
FIG. 3 is a schematic overall flow chart after determining whether the Resid cache count is abnormal in an embodiment of the present application;
reference numerals illustrate:
1. an execution module; 2. an abnormality determination module; 3. an abnormal data generation module; 4. an anomaly reading module; 5. and counting a heavy load module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be further described in detail with reference to the accompanying drawings.
An embodiment of the application discloses a cache synchronization system based on a Saas system, referring to FIG. 1, which comprises an execution module 1, an abnormality determination module 2, an abnormality data generation module 3, a quantity determination module 4 and a counting reload module 5;
the execution module 1 is used for executing the resin cache count to obtain a first count value, wherein the first count value is the quantity of unclear information, and the execution module 1 is electrically connected with the abnormality judgment module 2, the abnormality data generation module 3, the quantity judgment module 4 and the count reload module 5;
the abnormality determination module 2 is configured to determine whether the first count value is abnormal;
the abnormal data generation module 3 is used for generating abnormal cleaned data when the first count value is abnormal, the abnormal cleaned data comprises n pieces of first cleaned information, each piece of first cleaned information corresponds to one micro server, n is a natural number, and n is more than or equal to 1;
the quantity judging module 4 is used for reading the content of n pieces of first clear information, marking the first clear information with the same content as first abnormal information, wherein the first abnormal information corresponds to m micro servers, m is a natural number, and m is more than or equal to 1;
the counting reloading module 5 is used for taking a micro server which firstly looks over the first cleared information in the m micro servers as a local micro server, counting and reloading abnormal cleared data through the local micro server, and prohibiting other micro servers from counting and reloading;
the counting reloading module 5 is further configured to, after the local micro server performs counting reloading, release prohibition on other micro servers, and obtain a second count value generated after the counting reloading.
In the implementation, firstly, the execution module is used for carrying out the resin cache counting, the abnormality judging module is used for judging whether a first counting value obtained by the resin cache counting is abnormal, if so, the abnormal data generating module is used for generating abnormal clear data, the abnormal clear data comprises n pieces of first clear information, each piece of first clear information corresponds to one micro server, n is a natural number, n is more than or equal to 1, then, the abnormal reading module is used for reading the content of the n pieces of first clear information, the first clear information with the same content is marked as first abnormal information, finally, the micro server which firstly checks the first clear information in the m micro servers is used as a local micro server, the local micro server is used for carrying out counting reloading on the abnormal clear data, other micro servers are forbidden to carry out counting reloading, and after the local micro server carries out counting reloading, the inhibition on the other micro servers is relieved, and a second counting value generated after the counting reloading is obtained.
An embodiment of the present application further discloses a buffer synchronization method based on a Saas system, referring to fig. 2, specifically including the following steps:
s10, carrying out a resin cache count to obtain a first count value, and judging whether the first count value is abnormal or not, wherein the first count value is the number of unclear information;
in implementation, the method for performing the resin cache count specifically includes the following steps:
acquiring a preset relational database, wherein the relational database comprises information total data, and the information total data comprises unclean information and clean information;
and performing Redis cache counting on the total information data.
It should be noted that, the count value in the Redis is actually the result counted in the relational database, and is also the result counted by SQL query in MySQL, and the count reload is to count the value again and refresh the data in the Redis.
In an implementation, before acquiring the relational database, the method further comprises the steps of:
and creating a unique key value, wherein the unique key value is used for marking the number of the micro servers corresponding to the cleared information, recording the starting time of counting reloads and recording the related information of the micro servers of counting reloads.
It should be noted that, the number of micro servers that view the same piece of first cleaned information at the same time may be determined by setting a flag amount IsReload, and IsReload is detected, when IsReload is 1, it means that only one micro server views the first cleaned information, and if IsReload is greater than 1, it means that the number of micro servers that view the same piece of first cleaned information at the same time is not only one.
It should be further noted that the unique key value is a single field or a combination of fields to ensure that all values to be stored in the column are unique, and in the unique key value, the number of micro servers that simultaneously view the same piece of first clear information may be marked with a marking amount IsReload, the start time of the record counting Reload may be represented by exechdate, and the related information of the micro servers of the record counting Reload may be represented by Reload.
In implementation, referring to fig. 3, counting reloads further includes setting a local detection interval time, and after determining whether the Resid buffer count is abnormal, further includes the following steps:
a10, when the time reaches the set local detection interval time, judging whether counting overload is carried out in the local detection interval time;
a20, if the counting reload is carried out in the local detection interval time, local detection is not needed, the time for counting reload last time in the local detection interval time is obtained, the remaining time for carrying out the next local detection is calculated according to the local detection interval time from the time for counting reload last time, and if the counting reload is not carried out in the local detection interval time, the local detection is needed.
It should be noted that, the local micro-server performs local detection essentially by the local micro-server without depending on staff, and counts and reloads at preset time, and the local detection interval time can be set at self when registering the content of counting and reloading.
It should be noted that, when the counting reload is not performed within the preset local detection interval time, the counting reload is performed by local detection to avoid data accumulation, and when the counting reload is performed within the preset local detection interval time, the time for counting reload is required from the last time, the remaining time of the next local detection is calculated again according to the preset local detection interval time, and the local detection is ended.
In practice, after local detection is required, the method specifically comprises the following steps:
in the relational database, counting and reloading the cleared information, and prohibiting other micro servers from counting and reloading;
after the counting reloading is completed, the prohibition of other micro servers is released, and a third counting value generated after the counting reloading is obtained.
In the process of performing local detection, the local micro server actually performs counting reload by itself, so that a worker cannot perform counting reload by the local micro server at this time, and the local micro server performs counting reload by itself, so that other micro servers are prohibited from performing counting reload in order to avoid performing counting reload by other micro servers.
In implementation, the buffer synchronization method based on the Saas system further comprises the following steps:
in the relational database, if the number of the uncleaned information is reduced by a plurality of pieces, the number of the uncleaned information is correspondingly increased by a plurality of pieces, and if the number of the uncleaned information is increased by a plurality of pieces, the number of the uncleaned information is kept unchanged.
It should be noted that, a relationship between the number of pieces of uncleaned information and the number of pieces of cleared information is described, for example, when the number of pieces of uncleaned information is reduced by 5 pieces, the number of pieces of cleared information is correspondingly increased by 5 pieces, and when the number of pieces of uncleaned information is increased by 5 pieces, the number of pieces of cleared information is kept unchanged.
S20, if the first count value is abnormal, generating abnormal clear data, wherein the abnormal clear data comprises n pieces of first clear information, each piece of first clear information corresponds to a micro server, n is a natural number, and n is more than or equal to 1;
it should be noted that the exception is that the same piece of first cleaned information in the resin cache count is viewed by more than one micro server at the same time.
S30, reading the content of n pieces of first clear information, marking the first clear information with the same content as first abnormal information, wherein the first abnormal information corresponds to m micro servers, m is a natural number, and m is more than or equal to 1;
s40, taking the micro server which firstly checks the first clear information in the m micro servers as a local micro server, counting and reloading abnormal clear data through the local micro server, prohibiting other micro servers from counting and reloading, releasing the prohibition of other micro servers after the local micro server finishes counting and reloading, and acquiring a second count value generated after counting and reloading.
It should be noted that, in the process of counting reloading, the local micro server prohibits other micro servers from counting reloading, and similarly, in the process of counting reloading, other micro servers prohibits the local micro server from counting reloading, so that the phenomenon that the number of the unclean information data is reduced by two when a plurality of micro servers count the same unclean information data simultaneously in the process of consulting the same unclean information data is avoided.
In practice, counting reloads, comprising in particular the following steps:
counting all the first clear information with the same content as one first clear information, and carrying out reckoning on abnormal clear data to obtain normal clear data;
and according to the normal clear data, re-performing Redis cache counting on the total information data in the relational database.
It should be noted that, if a plurality of micro servers refer to the same piece of unclean information at the same time, after the total data of the information in the relational database is subjected to the Redis cache counting operation, the piece of unclean information is not converted into the cleaned information in the form of two or more pieces of unclean information, that is, no matter how many micro servers refer to the same piece of unclean information at the same time, the piece of unclean information is only subjected to one-time counting overload, and only the unclean information is reduced by one after the Redis cache counting operation is completed.
In one embodiment of the present application, when registering the content of the count reload, setting the local detection interval time to be 5 minutes, firstly, determining that the resin cache count is abnormal, 10 pieces of abnormal cleared information exist, determining that the local micro server is not performing local detection, then, according to the two results of the determination, determining whether 10 pieces of abnormal cleared information are respectively checked by more than one micro server, determining that 1 piece of abnormal cleared information is checked by 3 micro servers, then, taking the micro server which first checks the one piece of abnormal cleared information in the 3 micro servers as the local micro server, counting and reloading the first count value obtained by the resin cache count by the local micro server, and prohibiting other micro servers from performing count reload, then, after the local micro server performs count reload, releasing the second count value of the local micro server from performing the second dis after the count reload, and finally, reading the second micro count value of the local micro server from the dis.
In another embodiment of the present application, when registering the content of the reloading of the count, setting the local detection interval time to be 5 minutes, firstly, determining that the abnormality occurs in the count of the resin cache, 10 pieces of the abnormally cleared information exist, and determining that the local micro server is performing the local detection but is not required to perform the counting reloading because the counting reloading is performed within 5 minutes, then, according to the two results of the determination, determining whether 10 pieces of abnormally cleared information are respectively checked by more than one micro server, determining that 1 piece of abnormally cleared information is checked by 3 micro servers, then, taking the micro server which is used as the local micro server and is used for first checking the piece of abnormally cleared information in the 3 micro servers, performing the counting reloading on the first count value obtained by the count of the resin cache through the local micro server, and prohibiting the counting reloading of other micro servers, and then, after the local micro server is performing the counting reloading, performing the prohibition of the reloading on the other micro servers, finally, taking the second count value from the local micro server after the local micro server is completely performing the reading.
In one embodiment of the present application, when registering the content of the count reload, setting the local detection interval time to be 5 minutes, firstly, determining that the resin cache count is abnormal, 10 pieces of abnormal cleared information exist, determining that the local micro server is performing local detection, and because the count reload is not performed within 5 minutes, performing count reload, then, according to the two results of the determination, determining whether 10 pieces of abnormal cleared information are respectively checked by more than one micro server, determining that 1 piece of abnormal cleared information is checked by 3 micro servers, then, taking the micro server which first checks the piece of abnormal cleared information in the 3 micro servers as the local micro server, performing count reload on the first count value obtained by the resin cache count through the local micro server, and prohibiting other micro servers from performing count reload, then, performing prohibition on other micro servers to perform count reload, and finally, releasing the third count value from the local micro server after the local micro server is performing count reload.
Based on the same inventive concept, a further embodiment of the present application further discloses a computer readable storage medium, where at least one instruction, at least one program, a code set, or an instruction set is stored, where at least one instruction, at least one program, a code set, or an instruction set can be loaded by a processor and performed to implement the steps of a Saas system based cache synchronization method provided in the foregoing method embodiment.
The computer-readable storage medium includes, for example: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses and methods may be implemented in other manners, for example, the apparatus embodiments described above are merely illustrative, for example, the division of modules or units is merely a logical function division, and there may be additional manners of division in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution, in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
The foregoing embodiments are only used for describing the technical solution of the present application in detail, but the descriptions of the foregoing embodiments are only used for helping to understand the method and the core idea of the present application, and should not be construed as limiting the present application. Variations or alternatives that are readily contemplated by those skilled in the art within the scope of the present disclosure are intended to be encompassed within the scope of the present disclosure.

Claims (10)

1. The cache synchronization method based on the Saas system is characterized by comprising the following steps of:
performing a resin cache count to obtain a first count value, and judging whether the first count value is abnormal, wherein the first count value is the number of unclear information;
if the first count value is abnormal, generating abnormal clear data, wherein the abnormal clear data comprises n pieces of first clear information, each piece of first clear information corresponds to one micro server, n is a natural number, and n is more than or equal to 1;
reading the content of n pieces of first clear information, and marking the first clear information with the same content as first abnormal information, wherein the first abnormal information corresponds to m micro servers, m is a natural number, and m is more than or equal to 1;
taking the micro server which firstly looks over the first clear information in the m micro servers as a local micro server, counting and reloading the abnormal clear data through the local micro server, and prohibiting other micro servers from counting and reloading;
after the local micro server finishes counting reloading, the prohibition of other micro servers is released, and a second count value generated after counting reloading is obtained.
2. The Saas system based cache synchronization method according to claim 1, wherein said performing a resin cache count comprises the steps of:
acquiring a preset relational database, wherein the relational database comprises information total data, and the information total data comprises the unclean information and the clean information;
and performing Redis cache counting on the total information data.
3. The Saas system based cache synchronization method according to claim 2, further comprising the steps of:
in the relational database, if the number of the uncleaned information is reduced by a plurality of pieces, the number of the uncleaned information is correspondingly increased by a plurality of pieces, and if the number of the uncleaned information is increased by a plurality of pieces, the number of the uncleaned information is kept unchanged.
4. The Saas system based cache synchronization method according to claim 2, further comprising the steps of, before obtaining the relational database:
and creating a unique key value, wherein the unique key value is used for marking the number of the micro servers corresponding to the cleared information, recording the starting time of counting reloads and recording the related information of the micro servers carrying out the counting reloads.
5. The Saas system based cache synchronization method according to claim 2, wherein the counting reloads comprises the following steps:
counting all the first clear information with the same content as only one first clear information, and carrying out reckoning on the abnormal clear data to obtain normal clear data;
and according to the normal clear data, re-performing Redis cache counting on the total information data in the relational database.
6. The Saas system based cache synchronization method according to claim 5, wherein the counting reload further comprises setting a local detection interval time, and the step of after determining whether the Resid cache count is abnormal, further comprises the steps of:
when the time reaches the set local detection interval time, judging whether counting reload is carried out in the local detection interval time;
if the counting reload is carried out in the local detection interval time, local detection is not needed, the time for counting reload last time in the local detection interval time is obtained, and the remaining time for carrying out next local detection is calculated according to the local detection interval time from the time for counting reload last time;
if the counting reload is not carried out within the local detection interval time, local detection is needed.
7. The Saas system-based cache synchronization method according to claim 6, wherein after the local detection is required, the method specifically comprises the following steps:
in the relational database, counting and reloading the cleared information, and prohibiting other micro servers from counting and reloading;
after the counting reloading is completed, the prohibition of other micro servers is released, and a third counting value generated after the counting reloading is obtained.
8. The cache synchronization system based on the Saas system is characterized by comprising an execution module (1), an abnormality judgment module (2), an abnormal data generation module (3), an abnormality reading module (4) and a counting reload module (5);
the execution module (1) is used for executing the resin cache counting to obtain a first count value, the first count value is the quantity of unclear information, and the execution module (1) is electrically connected with the abnormality judgment module (2), the abnormality data generation module (3), the abnormality reading module (4) and the counting reload module (5);
the abnormality determination module (2) is configured to determine whether the first count value is abnormal;
the abnormal data generation module (3) is used for generating abnormal cleaned data when the first count value is abnormal, the abnormal cleaned data comprises n pieces of first cleaned information, each piece of first cleaned information corresponds to one micro server, n is a natural number, and n is more than or equal to 1;
the anomaly reading module (4) is used for reading the content of n pieces of first clear information, and marking the first clear information with the same content as first anomaly information, wherein the first anomaly information corresponds to m micro servers, m is a natural number, and m is more than or equal to 1;
the counting reloading module (5) is used for taking a micro server which firstly looks at the first cleared information in the m micro servers as a local micro server, counting and reloading the abnormal cleared data through the local micro server, and prohibiting other micro servers from counting and reloading;
the counting reloading module (5) is further used for releasing the prohibition of other micro servers after the local micro server finishes counting reloading, and obtaining a second counting value generated after the counting reloading.
9. An intelligent terminal, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program when executed by the processor implements a Saas system based cache synchronization method as claimed in claims 1-7.
10. A computer readable storage medium comprising a readable storage medium and a computer program stored thereon, the computer program being loaded and executed by a processor to implement a Saas system based cache synchronization method according to claims 1-7.
CN202311422890.0A 2023-10-30 2023-10-30 Cache synchronization method and system based on Saas system Pending CN117520007A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311422890.0A CN117520007A (en) 2023-10-30 2023-10-30 Cache synchronization method and system based on Saas system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311422890.0A CN117520007A (en) 2023-10-30 2023-10-30 Cache synchronization method and system based on Saas system

Publications (1)

Publication Number Publication Date
CN117520007A true CN117520007A (en) 2024-02-06

Family

ID=89750417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311422890.0A Pending CN117520007A (en) 2023-10-30 2023-10-30 Cache synchronization method and system based on Saas system

Country Status (1)

Country Link
CN (1) CN117520007A (en)

Similar Documents

Publication Publication Date Title
US7698602B2 (en) Systems, methods and computer products for trace capability per work unit
US8516499B2 (en) Assistance in performing action responsive to detected event
US7805630B2 (en) Detection and mitigation of disk failures
EP3488346B1 (en) Anomaly detection using sequences of system calls
CN110908880B (en) Buried point code injection method, event reporting method and related equipment thereof
CN110908920A (en) Interface function testing method and device and related components
CN109714249A (en) A kind of method for pushing and relevant apparatus of small routine message
CN108197002B (en) Mobile device non-buried point data statistical method, system, terminal and medium
CN109324959B (en) Method for automatically transferring data, server and computer readable storage medium
CN109634822B (en) Function time consumption statistical method and device, storage medium and terminal equipment
CN111309548A (en) Timeout monitoring method and device and computer readable storage medium
CN110975279A (en) Game data processing method and device, game server and storage medium
CN117520007A (en) Cache synchronization method and system based on Saas system
CN114637656B (en) Redis-based monitoring method and device, storage medium and equipment
CN104794040A (en) Service monitoring method, device and system
CN109725856B (en) Shared node management method and device, electronic equipment and storage medium
CN111427871B (en) Data processing method, device and equipment
CN113421109A (en) Service checking method, device, electronic equipment and storage medium
CN110362464B (en) Software analysis method and equipment
CN111581044A (en) Cluster optimization method, device, server and medium
CN113297053A (en) Method and device for determining test coverage rate and storage medium
CN114564369B (en) Application program abnormity monitoring method and device, electronic equipment and storage medium
CN115549990B (en) SQL injection detection method and device, electronic equipment and storage medium
CN109284408A (en) Figure bed Database Systems, figure bed database operation method and device
CN113613063B (en) Application anomaly reduction method, device and storage medium

Legal Events

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