A method and device for verifying data existence
By introducing data presence verification components in the business system, scanning and reflecting injection into the bitmap cache, the problems of high data presence verification cost and network overhead in the prior art are solved, and high performance and stable data existence are achieved sex verification.
Patent Information
- Application Number
- CN202111518611.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-12-13
AI Technical Summary
In the prior art, the cost of realizing data existence verification is high, and there is a negative impact on interface performance and stability due to network overhead.
By annotating bitmap cache annotations to the fields of the bitmap cache, and introducing data existence verification components in the business system. Based on the startup operation of the business system, all business fields marked with bitmap cache annotations are scanned, and from the middle of the distributed cache The bitmap cache is queryed in the file and reflected and injected into the business field to perform data existence verification.
It reduces implementation costs, avoids additional network overhead, improves interface performance and stability, and is suitable for scenarios with high concurrency and high performance requirements.
Smart Images

Figure CN114328511B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method and device for verifying data existence. Background Art
[0002] In business scenarios that require high-performance interfaces, there are a lot of scenarios for verifying whether data exists, such as whether the user is a new user, whether an activity exists, whether a merchant exists, etc. Considering interface performance and data storage space costs, a bitmap data structure is generally used for data storage to meet high standards for access and storage. Common implementation methods include local bitmap cache and distributed bitmap cache, but the implementation cost of local bitmap cache is high. Since the bitmap cache is maintained locally, when the source data is added or changed, it is necessary to access MQ separately to synchronize the bitmap cache data between clusters. Distributed bitmap cache has a layer of network overhead between the business container and the cache middleware, and there are glitches caused by network jitter, which is not suitable for scenarios with high concurrency and high performance requirements. Summary of the invention
[0003] One purpose of the present application is to provide a method and device for data existence verification to solve the problem in the prior art that the implementation cost is high and additional network overhead is required, which has a negative impact on the overall performance and stability of the interface.
[0004] According to one aspect of the present application, a method for verifying data existence is provided, the method comprising:
[0005] Mark the bitmap cache fields with bitmap cache annotations and introduce data existence verification components into the business system;
[0006] Based on the startup operation of the business system, all business fields marked with the bitmap cache annotation are scanned by the data existence verification component;
[0007] Based on the scanned business field, query the bitmap cache corresponding to the business field from the distributed cache middleware, and reflectively inject the queried bitmap cache into the corresponding business field annotated with the bitmap cache annotation;
[0008] The data existence check is performed on the obtained user access request based on the bitmap cache after reflection injection.
[0009] Optionally, the fields of the bitmap cache are annotated with bitmap cache annotations, including:
[0010] The data of the bitmap cache that needs to support business verification is stored locally, and the fields of the locally stored bitmap cache are marked with bitmap cache annotations.
[0011] Optionally, based on the startup operation of the business system, all business fields marked with the bitmap cache annotation are scanned by the data existence verification component, including:
[0012] Based on the startup operation of the business system, the bitmap cache of the business is loaded into the local memory;
[0013] All business fields marked with bitmap cache annotations in the local memory are scanned by the data existence verification component.
[0014] Optionally, querying a bitmap cache corresponding to the business field from a distributed cache middleware based on the scanned business field includes:
[0015] Based on the scanned business field, a query request is sent to the distributed cache middleware, so that the distributed cache middleware matches the bitmap cache corresponding to the business field from the configured business data based on the query request, wherein the configured business data is synchronized to the distributed cache middleware by the business management console application, including the bitmap cache of the business.
[0016] Optionally, the method comprises:
[0017] When the reflection injection is completed, starting the bitmap cache change monitoring task in the data existence verification component;
[0018] Based on the change event monitored by the monitoring task, a new bitmap cache is requeried and reflected and injected into the corresponding business field annotated with the bitmap cache annotation.
[0019] Optionally, re-querying a new bitmap cache based on the change event monitored by the monitoring task includes:
[0020] Based on the changes in the business data synchronized from the business management console application to the distributed cache middleware, adjusting the change status of the corresponding bitmap cache in the distributed cache middleware;
[0021] The change status of the bitmap cache is periodically polled by the monitoring task, and a new bitmap cache is re-queried from the distributed cache based on the change status.
[0022] Optionally, data existence verification is performed on the obtained user access request according to the bitmap cache after reflection injection, including:
[0023] Forwarding the acquired user's access request to the business data to the data existence verification component;
[0024] The access request is verified for data existence through the bitmap cache after reflection injection in the data existence verification component, and the business data is returned, wherein the access request includes a bitmap cache request for the business data in the local memory.
[0025] According to another aspect of the present application, a device for verifying data existence is also provided, the device comprising:
[0026] An introduction device is used to annotate the fields of the bitmap cache with bitmap cache annotations and introduce a data existence verification component into the business system;
[0027] A scanning device, used for scanning all business fields marked with bitmap cache annotations through the data existence verification component based on the startup operation of the business system;
[0028] A filling device, used for querying the bitmap cache corresponding to the business field from the distributed cache middleware based on the scanned business field, and injecting the queried bitmap cache reflection into the corresponding business field marked with the bitmap cache annotation;
[0029] The verification device is used to perform data existence verification on the obtained user access request based on the bitmap cache after reflection injection.
[0030] According to another aspect of the present application, a device for verifying data existence is also provided, the device comprising:
[0031] one or more processors; and
[0032] A memory storing computer readable instructions, which, when executed, cause the processor to perform the operations of the method as described above.
[0033] According to another aspect of the present application, a computer-readable medium is provided, on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the method described above.
[0034] Compared with the prior art, this application marks the fields of the bitmap cache with bitmap cache annotations and introduces a data existence verification component in the business system; based on the startup operation of the business system, the data existence verification component scans all business fields marked with bitmap cache annotations; based on the scanned business fields, the bitmap cache corresponding to the business fields is queried from the distributed cache middleware, and the queried bitmap cache is reflected and injected into the corresponding business fields marked with bitmap cache annotations; data existence verification is performed on the obtained user access request based on the bitmap cache after reflection injection. This reduces the implementation cost while avoiding the negative impact of additional network overhead on the overall performance and stability of the docking interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0036] Figure 1 A schematic diagram of a method flow for verifying data existence provided according to one aspect of the present application is shown;
[0037] Figure 2 An interactive schematic diagram of data existence verification in one embodiment of the present application is shown;
[0038] Figure 3 A schematic structural diagram of a data existence verification device provided according to another aspect of the present application is shown.
[0039] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0040] The present application is described in further detail below in conjunction with the accompanying drawings.
[0041] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (eg, a central processing unit (CPU)), an input / output interface, a network interface and a memory.
[0042] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0043] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, Phase-Change RAM (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of random access memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0044] Figure 1 A flow chart of a method for data existence verification provided according to one aspect of the present application is shown, the method comprising: steps S11 to S14, wherein, in step S11, the fields of the bitmap cache are marked with bitmap cache annotations, and a data existence verification component is introduced into the business system; in step S12, based on the startup operation of the business system, all business fields marked with bitmap cache annotations are scanned by the data existence verification component; in step S13, based on the scanned business fields, the bitmap cache corresponding to the business fields is queried from the distributed cache middleware, and the queried bitmap cache is reflectively injected into the corresponding business fields marked with bitmap cache annotations; in step S14, data existence verification is performed on the obtained user access request according to the bitmap cache after reflection injection. This reduces the implementation cost while avoiding the negative impact of the overall performance and stability of the docking interface caused by the additional network overhead.
[0045] Specifically, in step S11, the fields of the bitmap cache are marked with bitmap cache annotations, and a data existence verification component is introduced into the business system; here, the fields of the bitmap cache are encapsulated, and the bitmap cache is encapsulated in the form of annotation fields to automatically perform local cache processing, which can reduce implementation costs; and the data existence verification component is introduced into the business system, so that the component provides high-concurrency and high-performance data existence verification support to the business system by supporting the local bitmap cache form of automatic synchronization of cached data.
[0046] Specifically, in step S12, based on the startup operation of the business system, all business fields marked with the bitmap cache annotation are scanned by the data existence verification component; here, when the business system is started, the data existence verification component will also be initialized, and the component will scan all business fields marked with the bitmap cache annotation. Then, in step S13, based on the scanned business field, the bitmap cache corresponding to the business field is queried from the distributed cache middleware, and the queried bitmap cache is reflected and injected into the corresponding business field marked with the bitmap cache annotation; here, the bitmap cache corresponding to all business fields marked with the bitmap cache annotation is batch queried from the distributed cache middleware, and then the queried bitmap cache is respectively injected into the corresponding business field marked with the bitmap cache annotation through reflection.
[0047] Specifically, in step S14, the obtained user access request is verified for data existence according to the bitmap cache after reflection injection. Here, when the user accesses data for data existence verification, the verification is always performed through the bitmap cache after reflection injection, thereby achieving low cost and high concurrency to ensure the stability of the interface in high-performance scenarios.
[0048] In some embodiments of the present application, in step S11, the data of the bitmap cache that needs to support business verification is stored locally, and the fields of the locally stored bitmap cache are marked with bitmap cache annotations. Then, in step S12, based on the startup operation of the business system, the bitmap cache of the business is loaded into the local memory; all business fields in the local memory marked with bitmap cache annotations are scanned by the data existence verification component. Here, the bitmap cache annotation is marked on the specific field of the localization of the bitmap cache data that needs to support business verification, the system starts loading the business bitmap into the local memory, and all business fields marked with bitmap cache annotations are scanned from the local memory by the data existence verification component. The bitmap cache data can be assigned to the member attributes of the object in the form of local cache for business use, and the cached fields are marked by annotations to indicate that they are fields that need to synchronize bitmap data changes, which can be used to synchronize to the local cache in time through the component to update the value of the local variable when the bitmap data in the business data source is maintained. Thereby, the work cost of the business party to develop and maintain the local cache member attribute values by itself can be reduced.
[0049] Then, in step S13, a query request is sent to the distributed cache middleware based on the scanned business field, so that the distributed cache middleware matches the bitmap cache corresponding to the business field from the configured business data based on the query request, wherein the configured business data is synchronized from the business management station application to the distributed cache middleware, including the bitmap cache of the business. Figure 2 As shown, after scanning all business fields marked with the bitmap cache annotation through the data existence verification component, the bitmap cache corresponding to all business fields marked with the bitmap cache annotation is loaded in batches, and a request to query the bitmap cache is sent to the distributed cache middleware, so that the distributed cache middleware returns the bitmap cache, and the returned cache is injected into the corresponding business field marked with the bitmap cache annotation on the data existence verification component. Among them, the business management desk application configures the business data and synchronizes the configured business data as a bitmap cache to the distributed cache middleware. The business data configured by the business management desk application is used for legitimacy verification, such as: a valid activity list id message, which is used to verify whether the activity exists; a new user list id message, which is used to determine whether the user is a new user; a valid product list id message, which is used to verify whether the product is valid.
[0050] It should be noted that loading the cache only queries the cache from the distributed middleware, and does not assign it to the corresponding local member attribute variable. Reflection injection is to fill the queried bitmap cache into the corresponding local member attribute variable. The business management application stores the bitmap in the distributed cache middleware to improve the access performance of the bitmap data. The bitmap cache is also stored in each business application container in the cluster to further improve the access performance of the bitmap data and reduce the network jitter caused by direct access to the distributed cache middleware. Among them, each business application container is each virtual machine in the cluster.
[0051] In some embodiments of the present application, the method includes: after the reflection injection is completed, starting the bitmap cache change monitoring task in the data existence verification component; re-querying the new bitmap cache based on the change event monitored by the monitoring task, and reflectively injecting it into the business field corresponding to the bitmap cache annotation. Figure 2 After the cache data of the business field is reflected and injected (filled), the data existence verification component starts a separate bitmap cache change monitoring task. The monitoring task monitors the changes in the business data bitmap cache during regular polling. When a change event is detected, the bitmap cache is re-queried and injected into the corresponding business field marked with the bitmap cache annotation through reflection.
[0052] Specifically, based on the changes in the business data synchronized from the business management station application to the distributed cache middleware, the change status of the corresponding bitmap cache in the distributed cache middleware is adjusted; the change status of the bitmap cache is periodically polled by the monitoring task, and a new bitmap cache is re-queried from the distributed cache based on the change status. Here, when the user changes the business data in the business management station application, the change status of the corresponding bitmap cache in the distributed cache middleware will be adjusted, the business management station application will synchronize the configuration business data changes to the distributed cache middleware, start the bitmap cache change monitoring task, and the distributed cache middleware returns the bitmap cache change status. When the monitoring task is polled regularly, if the value of a bitmap cache field of the business data is detected to have changed, data synchronization will be automatically performed, and the bitmap cache will be re-queried and injected into the corresponding business field marked with the bitmap cache annotation through reflection. When the user accesses the data to verify the existence of the data, it always verifies through the synchronized latest business data bitmap cache, which can quickly and cheaply realize the stability guarantee of the interface in high concurrency and high performance scenarios.
[0053] In some embodiments of the present application, in step S14, the obtained user access request for business data is forwarded to the data existence verification component; the access request is verified for data existence through the bitmap cache injected by reflection in the data existence verification component, and the business data is returned, wherein the access request includes a request for the bitmap cache of business data in local memory. Here, during the access process, the user issues an access request for the bitmap cache of business data in local memory, and the business system locally caches the access business data bitmap in the data existence verification component, and the data existence verification component performs a data existence verification on the access request through the bitmap cache injected by reflection, and returns the business data.
[0054] The data existence verification component in this application provides high-concurrency and high-performance data existence verification support to the business system by supporting local bitmap caching that automatically synchronizes cached data; it encapsulates the business bitmap cache in the form of annotated fields to automatically perform local cache processing and synchronize the refresh of the local business bitmap cache of each container in the cluster when the business bitmap cache changes, thereby reducing the implementation cost and avoiding the negative impact of additional network overhead on the overall performance and stability of the interface.
[0055] In addition, an embodiment of the present application also provides a computer-readable medium on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the aforementioned method of verifying the existence of data.
[0056] Corresponding to the method described above, the present application also provides a terminal, which includes a terminal capable of executing the above Figure 1 or Figure 2 The modules or units of the method steps described in each embodiment may be implemented by hardware, software, or a combination of hardware and software, which is not limited in this application. For example, in one embodiment of this application, a device for data existence verification is also provided, and the device includes:
[0057] one or more processors; and
[0058] A memory storing computer readable instructions, which, when executed, cause the processor to perform the operations of the method as described above.
[0059] For example, the computer readable instructions, when executed, cause the one or more processors to:
[0060] Mark the bitmap cache fields with bitmap cache annotations and introduce data existence verification components into the business system;
[0061] Based on the startup operation of the business system, all business fields marked with the bitmap cache annotation are scanned by the data existence verification component;
[0062] Based on the scanned business field, query the bitmap cache corresponding to the business field from the distributed cache middleware, and reflectively inject the queried bitmap cache into the corresponding business field annotated with the bitmap cache annotation;
[0063] The data existence check is performed on the obtained user access request based on the bitmap cache after reflection injection.
[0064] Figure 3 A structural schematic diagram of a data existence verification device provided according to another aspect of the present application is shown, the device comprising: an introduction device 11, a scanning device 12, a filling device 13 and a verification device 14, wherein the introduction device 11 is used to mark the fields of the bitmap cache with bitmap cache annotations and introduce a data existence verification component into the business system; the scanning device 12 is used to scan all business fields marked with bitmap cache annotations through the data existence verification component based on the startup operation of the business system; the filling device 13 is used to query the bitmap cache corresponding to the business field from the distributed cache middleware based on the scanned business field, and reflectively inject the queried bitmap cache into the corresponding business field marked with the bitmap cache annotation; the verification device 14 is used to perform data existence verification on the obtained user access request based on the bitmap cache after reflection injection.
[0065] It should be noted that the contents executed by the introduction device 11, the scanning device 12, the filling device 13 and the verification device 14 are respectively the same or correspondingly the same as the contents in the above steps S11, S12, S13 and S14, and are not repeated here for the sake of simplicity.
[0066] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
[0067] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0068] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instruction for calling the method of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in a working memory of a computer device that runs according to the program instruction. Here, according to an embodiment of the present application, a device is included, the device including a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instruction is executed by the processor, the device is triggered to run the method and / or technical solution based on the aforementioned multiple embodiments according to the present application.
[0069] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for verifying data existence, characterized in that: The method comprises: Mark the bitmap cache fields with bitmap cache annotations and introduce data existence verification components into the business system; Based on the startup operation of the business system, all business fields marked with the bitmap cache annotation are scanned by the data existence verification component; Based on the scanned business field, query the bitmap cache corresponding to the business field from the distributed cache middleware, and reflectively inject the queried bitmap cache into the corresponding business field annotated with the bitmap cache annotation; Perform data existence verification on the obtained user access request based on the bitmap cache after reflection injection; Among them, the bitmap cache fields are marked with bitmap cache annotations, including: The data of the bitmap cache that needs to support business verification is stored locally, and the fields of the locally stored bitmap cache are marked with bitmap cache annotations; Wherein, based on the startup operation of the business system, all business fields marked with the bitmap cache annotation are scanned by the data existence verification component, including: Based on the startup operation of the business system, the bitmap cache of the business is loaded into the local memory; All business fields marked with bitmap cache annotations in the local memory are scanned by the data existence verification component.
2. The method according to claim 1, characterized in that Based on the scanned business field, querying the bitmap cache corresponding to the business field from the distributed cache middleware includes: Based on the scanned business field, a query request is sent to the distributed cache middleware, so that the distributed cache middleware matches the bitmap cache corresponding to the business field from the configured business data based on the query request, wherein the configured business data is synchronized to the distributed cache middleware by the business management console application, including the bitmap cache of the business.
3. The method according to claim 1, characterized in that The method comprises: When the reflection injection is completed, starting the bitmap cache change monitoring task in the data existence verification component; Based on the change event monitored by the monitoring task, a new bitmap cache is requeried and reflected and injected into the corresponding business field annotated with the bitmap cache annotation.
4. The method according to claim 3, characterized in that Re-querying a new bitmap cache based on the change event monitored by the monitoring task includes: Based on the changes in the business data synchronized from the business management console application to the distributed cache middleware, adjusting the change status of the corresponding bitmap cache in the distributed cache middleware; The change status of the bitmap cache is periodically polled by the monitoring task, and a new bitmap cache is re-queried from the distributed cache based on the change status.
5. The method according to claim 1, characterized in that Perform data existence verification on the obtained user access request based on the bitmap cache after reflection injection, including: Forwarding the acquired user's access request to the business data to the data existence verification component; The access request is verified for data existence through the bitmap cache after reflection injection in the data existence verification component, and the business data is returned, wherein the access request includes a bitmap cache request for the business data in the local memory.
6. A device for verifying data existence, characterized in that: The device comprises: An introduction device is used to annotate the fields of the bitmap cache with bitmap cache annotations and introduce a data existence verification component into the business system; A scanning device, used for scanning all business fields marked with bitmap cache annotations through the data existence verification component based on the startup operation of the business system; A filling device, used for querying the bitmap cache corresponding to the business field from the distributed cache middleware based on the scanned business field, and injecting the queried bitmap cache reflection into the corresponding business field marked with the bitmap cache annotation; A verification device, used for performing data existence verification on the obtained user access request according to the bitmap cache after reflection injection; Wherein, the introduction device is used for: The data of the bitmap cache that needs to support business verification is stored locally, and the fields of the locally stored bitmap cache are marked with bitmap cache annotations; Wherein, the scanning device is used for: Based on the startup operation of the business system, the bitmap cache of the business is loaded into the local memory; All business fields marked with bitmap cache annotations in the local memory are scanned by the data existence verification component.
7. A device for verifying the existence of data, characterized in that: The device comprises: one or more processors; and A memory storing computer readable instructions which, when executed, cause the processor to perform the operations of the method as claimed in any one of claims 1 to 5.
8. A computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Distributed configuration implementation method and equipment
CN113342852A