WO2020233374A1 - 一种业务平台缓存策略的测试方法及装置 - Google Patents

一种业务平台缓存策略的测试方法及装置 Download PDF

Info

Publication number
WO2020233374A1
WO2020233374A1 PCT/CN2020/087741 CN2020087741W WO2020233374A1 WO 2020233374 A1 WO2020233374 A1 WO 2020233374A1 CN 2020087741 W CN2020087741 W CN 2020087741W WO 2020233374 A1 WO2020233374 A1 WO 2020233374A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
test data
strategy
database
cache database
Prior art date
Application number
PCT/CN2020/087741
Other languages
English (en)
French (fr)
Inventor
刘芳
吕小立
刘丽珍
Original Assignee
深圳壹账通智能科技有限公司
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 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020233374A1 publication Critical patent/WO2020233374A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • 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/23Updating
    • 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

Definitions

  • This application relates to the technical field of research and development management, and in particular to a method and device for testing a business platform cache strategy.
  • the Demand-Side Platform refers to a cross-media, cross-platform, and cross-terminal advertising platform for advertisers.
  • the delivery strategy and delivery factors jointly determine the bidding results of the advertising demand-side platform.
  • the inventor found that if advertiser A adds a new delivery strategy to the front-end UI page, and the database called by the advertising demander's platform bid response does not update the new delivery strategy, then the DSP platform cannot be based on the new delivery strategy. Respond to bidding requests in a timely manner. However, it is difficult to judge the accuracy of the caching logic when testing the caching strategy of the existing advertising demand-side platform.
  • a method and device for testing a service platform cache strategy are provided.
  • a testing method for a business platform cache strategy includes:
  • the test data wherein the main database generates a cache instruction after reading the test data, and counts the time when the reading is started as the first time; after the first time to the update interval time, the The cache database executes the cache operation of the test data in response to the cache instruction; and queries the test data through the query interface of the cache database to determine whether the cache logic of the cache database is correct.
  • a testing device for a business platform cache strategy comprising: a setting unit for setting the update interval time of the cache database of the business platform; a creation unit for creating test data through preset rules and sending it to the preset The test data is imported into a test script; an import unit is configured to use the test script to import the test data into the main database of the business platform, wherein the main database generates a cache instruction after reading the test data , And count the start of reading as the first time; the execution unit is configured to execute the test data in response to the cache instruction after the first time to the update interval. Cache operation; a query unit for querying the test data through the query interface of the cache database to determine whether the cache logic of the cache database is correct.
  • a computer non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the following method are implemented:
  • the main database Import the test data into the main database of the service platform by using the test script, wherein the main database generates a cache instruction after reading the test data, and counts the time when the reading starts as the first time;
  • the cache database After the first time to the update interval, the cache database responds to the cache instruction to perform a cache operation of the test data;
  • test data is queried through the query interface of the cache database to determine whether the cache logic of the cache database is correct.
  • a computer device includes a memory, a processor, and a computer program that is stored in the memory and can run on the processor, and the processor implements the following method steps when the computer program is executed:
  • the main database Import the test data into the main database of the service platform by using the test script, wherein the main database generates a cache instruction after reading the test data, and counts the time when the reading starts as the first time;
  • the cache database After the first time to the update interval, the cache database responds to the cache instruction to perform a cache operation of the test data;
  • test data is queried through the query interface of the cache database to determine whether the cache logic of the cache database is correct.
  • FIG. 1 is a flowchart of a method for testing an optional service platform caching strategy provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of an optional testing device for a service platform caching strategy provided by an embodiment of the present application
  • Fig. 3 is a schematic diagram of an optional computer device provided by an embodiment of the present application.
  • first, second, third, etc. may be used to describe terminals in the embodiments of the present application, these terminals should not be limited to these terms. These terms are only used to distinguish terminals from each other.
  • first obtaining subunit may also be referred to as the second obtaining subunit, and similarly, the second obtaining subunit may also be referred to as the first obtaining subunit.
  • the word “if” as used herein can be interpreted as “when” or “when” or “in response to determination” or “in response to detection”.
  • the phrase “if determined” or “if detected (statement or event)” can be interpreted as “when determined” or “in response to determination” or “when detected (statement or event) )” or “in response to detection (statement or event)”.
  • Fig. 1 is a flowchart of a method for testing a service platform caching strategy according to an embodiment of the present application. As shown in Fig. 1, the method includes:
  • Step S101 setting the update interval time of the cache database of the service platform
  • Step S102 creating test data according to preset rules, and importing the test data into the preset test script
  • Step S103 using the test script to import the test data into the main database of the service platform, where the main database generates a cache instruction after reading the test data, and the time when the reading starts is counted as the first moment;
  • Step S104 after the first moment to the update interval, the cache database responds to the cache instruction to perform a cache operation of the test data;
  • Step S105 Query the test data through the query interface of the cache database to determine whether the cache logic of the cache database is correct.
  • the business platform may be, for example, an advertising demand-side platform (Demand-Side Platform, DSP).
  • the business platform includes a main database and a cache database.
  • the main database is used to store all data related to the business platform, and the cache database is used to store strategy factors.
  • the cache database is a redis database, which is stored in a key-value format. Redis uses memory as a data storage medium, so the efficiency of reading and writing data is extremely high, far exceeding the main database. Taking setting and obtaining a 256-byte string as an example, its reading speed can be as high as 110,000 times/s, and its writing speed can be as high as 81,000 times/s.
  • the DSP interface may receive a large number of bidding requests per second, and the response timeliness requirements are very high.
  • test data is SQL statements
  • test script is python
  • the update interval of the cache database is 5 seconds.
  • the test data is a strategy factor required by the business platform, and each strategy factor is associated with an advertiser ID; specifically, the strategy factor includes multiple placement factors.
  • Each advertiser will set its own advertising strategy. For example, the strategy factors set by advertiser A are shown in Table 1;
  • the cache database responds to the cache instruction to perform a cache operation of the test data, including:
  • test data is stored in the cache database in the form of key-value pairs, where the test data includes at least one of the new strategy factor, the deleted strategy factor, and the updated strategy factor, and the identity code of the advertiser associated with each strategy factor As a key, each strategy factor is used as a value.
  • the caching strategy is tested through three scenarios, which can cover the situation of the strategy data in actual applications.
  • query the test data through the query interface of the cache database to determine whether the cache logic of the cache database is correct including:
  • the advertiser s identity code through the query interface of the cache database; obtain the target strategy factor associated with the identity code in the cache database; when the test data is a new strategy factor, judge whether the target strategy factor is the same as the new strategy factor; if yes , Confirm that the new strategy factor has been stored in the cache database and the cache logic is correct.
  • the strategy factor obtained by querying "Advertiser A" is consistent with the new strategy factor associated with Advertiser A in the test data, which means that the logic of the cache database when synchronizing the new strategy factor is correct.
  • query the test data through the query interface of the cache database to determine whether the cache logic of the cache database is correct which also includes:
  • the advertiser’s identity code through the query interface of the cache database; obtain the target strategy factor associated with the identity code in the cache database; when the test data is an update strategy factor, judge whether the target strategy factor is the same as the update strategy factor; if so, confirm The cache database has replaced the original strategy factor associated with the advertiser's identity code with the updated strategy factor, and the cache logic is correct.
  • the strategy factor obtained by querying "Advertiser A" is consistent with the update strategy factor associated with Advertiser A in the test data, and the original strategy factor with the same number as the update strategy factor has been deleted, which means that the cache database is updating strategy factors
  • the logic of the time is correct.
  • query the test data through the query interface of the cache database to determine whether the cache logic of the cache database is correct which also includes:
  • the advertiser's identity code through the query interface of the cache database; when the test data is a deletion strategy factor, determine whether there is a deletion strategy factor in the cache database; when there is no deletion strategy factor in the cache database, confirm that the cache database has deleted the strategy factor , The cache logic is correct. For example, in the strategy factors obtained by querying "Advertiser B", there is no strategy factor consistent with the deletion strategy factor associated with Advertiser B in the test data, which means that the logic of deleting the strategy factor in the cache database is correct.
  • the method further includes:
  • X(Expected bid) P(k1*a1*b1+k2*a2*b2+...+kn*an*bn)/(k1+k2+...+kn), where P represents the default bid, an Denotes the nth strategy factor, kn denotes the weight of the n th strategy factor, and bn denotes the matching degree of the n th strategy factor.
  • the matching degree of the strategy factor is the coincidence degree of the delivery factor of the strategy factor.
  • the delivery factor of the traffic channel is "OneConnect, OneWallet, Sina Portal”
  • the delivery factor used in the actual bid is "OneConnect, OneWallet”
  • the matching degree is 67%. Then the bid when the expected matching degree is 100% is necessarily different from the bid when the actual matching degree is 67%.
  • the actual bid of the new strategy factor is the same as the expected bid, that is, the business platform is considered to be the correct new strategy factor called, and the new strategy factor has been synchronized to the update interval from the first moment to the update interval. Cache the database. If they are different, it means that the strategy factor called by the business platform is other similar strategy factors in the cache database, so the actual bid will be biased.
  • the embodiment of the present application provides a testing device for a service platform cache strategy.
  • the device is used to execute the foregoing testing method for a service platform cache strategy.
  • the device includes: a setting unit 10, a creation unit 20, and an import unit 30.
  • Execution unit 40 and query unit 50 are included in the device.
  • the setting unit 10 is used to set the update interval time of the cache database of the business platform
  • the creation unit 20 is used to create test data according to preset rules, and import the test data into the preset test script;
  • the import unit 30 is used for importing test data into the main database of the business platform by using a test script, where the main database generates a cache instruction after reading the test data, and counts the time when the reading is started as the first moment;
  • the execution unit 40 is configured to execute the cache operation of the test data in response to the cache instruction from the first moment to after the update interval.
  • the query unit 50 is used to query the test data through the query interface of the cache database to determine whether the cache logic of the cache database is correct.
  • the business platform may be, for example, an advertising demand-side platform (Demand-Side Platform, DSP).
  • the business platform includes a main database and a cache database.
  • the main database is used to store all data related to the business platform, and the cache database is used to store strategy factors.
  • the cache database is a redis database, which is stored in a key-value format. Redis uses memory as a data storage medium, so the efficiency of reading and writing data is extremely high, far exceeding the main database. Taking setting and obtaining a 256-byte string as an example, its reading speed can be as high as 110,000 times/s, and its writing speed can be as high as 81,000 times/s.
  • the DSP interface may receive a large number of bidding requests per second, and the response timeliness requirements are very high.
  • test data is SQL statements
  • test script is python
  • the update interval of the cache database is 5 seconds.
  • the test data is a strategy factor required by the business platform, and each strategy factor is associated with an advertiser ID; specifically, the strategy factor includes multiple placement factors. Each advertiser will set his own advertising strategy, as shown in Table 1.
  • the execution unit 40 includes an execution subunit for storing the test data in the cache database in the form of key-value pairs, where the test data includes at least one strategy among the newly added strategy factor, the deleted strategy factor, and the updated strategy factor.
  • Factor the identity code of the advertiser associated with each strategy factor is used as a key, and each strategy factor is used as a value.
  • the caching strategy is tested through three scenarios, which can cover the situation of the strategy data in actual applications.
  • the query unit 50 includes a query subunit, an acquisition subunit, a first judgment subunit, and a first confirmation subunit.
  • the query subunit is used to query the identity code of the advertiser through the query interface of the cache database; the acquisition subunit is used to obtain the target strategy factor associated with the identity code in the cache database; the first judgment subunit is used to test data When it is a new strategy factor, it is judged whether the target strategy factor is the same as the newly added strategy factor; the first confirmation subunit is used to confirm that the new strategy factor has been stored in the cache database and the cache logic is correct. For example, the strategy factor obtained by querying "Advertiser A" is consistent with the new strategy factor associated with Advertiser A in the test data, which means that the logic of the cache database when synchronizing the new strategy factor is correct.
  • the query unit 50 further includes a second judgment subunit and a second confirmation subunit.
  • the second determination subunit is used to determine whether the target strategy factor is the same as the update strategy factor when the test data is the update strategy factor; the second confirmation subunit is used to confirm that the cache database has been replaced with the advertiser with the update strategy factor.
  • the original strategy factor associated with the identity code, the cache logic is correct. For example: the strategy factor obtained by querying "Advertiser A" is consistent with the update strategy factor associated with Advertiser A in the test data, and the original strategy factor with the same number as the update strategy factor has been deleted, which means that the cache database is updating strategy factors The logic of the time is correct.
  • the query unit 50 further includes a third judgment subunit and a third confirmation subunit.
  • the third judging subunit is used to judge whether there is a deletion strategy factor in the cache database when the test data is a deletion strategy factor; the third confirmation subunit is used to confirm that the cache database has been deleted when there is no deletion strategy factor in the cache database Delete the strategy factor, the cache logic is correct. For example, in the strategy factors obtained by querying "Advertiser B", there is no strategy factor consistent with the deletion strategy factor associated with Advertiser B in the test data, which means that the logic of deleting the strategy factor in the cache database is correct.
  • the device further includes an input unit, a calculation unit, a judgment unit, and a confirmation unit.
  • the input unit is used to input the new strategy factor to the business platform and obtain the actual bid of the new strategy factor through the bid interface of the business platform; the calculation unit is used to calculate the new strategy based on the new strategy factor and preset business logic The expected bid of the factor; the judging unit is used to judge whether the actual bid is consistent with the expected bid; the confirming unit is used to confirm, if so, that the database where the strategy factor actually called by the business platform is located is a cache database.
  • X(expected bid) P(k1*a1*b1+k2*a2*b2+...+kn*an*bn)/(k1+k2+...+kn), where P represents the default bid, an Denotes the nth strategy factor, kn denotes the weight of the n th strategy factor, and bn denotes the matching degree of the n th strategy factor.
  • the matching degree of the strategy factor is the coincidence degree of the delivery factor of the strategy factor.
  • the delivery factor of the traffic channel is "OneConnect, OneWallet, Sina Portal”
  • the delivery factor used in the actual bid is "OneConnect, OneWallet”
  • the matching degree is 67%. Then the bid when the expected matching degree is 100% is necessarily different from the bid when the actual matching degree is 67%.
  • the actual bid of the new strategy factor is the same as the expected bid, that is, the business platform is considered to be the correct new strategy factor called, and the new strategy factor has been synchronized to the update interval from the first moment to the update interval. Cache the database. If they are different, it means that the strategy factor called by the business platform is other similar strategy factors in the cache database, so the actual bid will be biased.
  • the embodiment of the present application provides a computer non-volatile storage medium, the storage medium includes a stored program, wherein the device where the storage medium is located is controlled to perform the following steps when the program runs:
  • Set the update interval of the cache database of the business platform create test data through preset rules and import the test data into the preset test script; use the test script to import the test data into the main database of the business platform, where the main database
  • a cache instruction is generated, and the time when the reading is started is counted as the first time; after the first time to the update interval, the cache database executes the cache operation of the test data in response to the cache instruction;
  • the query interface queries the test data to determine whether the cache logic of the cache database is correct.
  • the device where the storage medium is located is controlled to perform the following steps: the test data is stored in the cache database in the form of key-value pairs, where the test data includes new strategy factors, deletion strategy factors, and update strategy factors. At least one strategy factor, the identity code of the advertiser associated with each strategy factor is used as a key, and each strategy factor is used as a value.
  • the device where the storage medium is located is controlled to perform the following steps: query the advertiser’s identity code through the query interface of the cache database; obtain the target strategy factor associated with the identity code in the cache database; when the test data is new For strategy factors, judge whether the target strategy factor is the same as the newly added strategy factor; if so, confirm that the new strategy factor has been stored in the cache database and the cache logic is correct.
  • the device where the storage medium is located is controlled to perform the following steps: query the identity code of the advertiser through the query interface of the cache database; obtain the target strategy factor associated with the identity code in the cache database; when the test data is an update strategy When factoring, determine whether the target strategy factor is the same as the update strategy factor; if so, confirm that the cache database has replaced the original strategy factor associated with the advertiser’s identity code with the update strategy factor, and the cache logic is correct.
  • the device where the storage medium is located is controlled to perform the following steps: query the identity code of the advertiser through the query interface of the cache database; when the test data is a deletion strategy factor, determine whether there is a deletion strategy factor in the cache database; When the deletion strategy factor does not exist in the cache database, confirm that the cache database has deleted the strategy factor and the cache logic is correct.
  • the aforementioned computer storage medium may be non-volatile or volatile.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
  • the computer device 100 of this embodiment includes a processor 101, a memory 102, and a computer program 103 that is stored in the memory 102 and can run on the processor 101.
  • the computer program 103 is executed by the processor 101, To implement the test method of the service platform cache strategy in the embodiment, in order to avoid repetition, it will not be repeated here.
  • the computer program is executed by the processor 101, the function of each model/unit in the test device of the service platform cache strategy in the embodiment is realized. In order to avoid repetition, it will not be repeated here.
  • the computer device 100 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer device may include, but is not limited to, a processor 101 and a memory 102.
  • FIG. 3 is only an example of the computer device 100, and does not constitute a limitation on the computer device 100. It may include more or less components than shown in the figure, or a combination of certain components, or different components.
  • computer equipment may also include input and output devices, network access devices, buses, and so on.
  • the so-called processor 101 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 102 may be an internal storage unit of the computer device 100, such as a hard disk or memory of the computer device 100.
  • the memory 102 may also be an external storage device of the computer device 100, such as a plug-in hard disk equipped on the computer device 100, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, and a flash memory card (Flash). Card) and so on.
  • the memory 102 may also include both an internal storage unit of the computer device 100 and an external storage device.
  • the memory 102 is used to store computer programs and other programs and data required by the computer equipment.
  • the memory 102 can also be used to temporarily store data that has been output or will be output.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined Or it can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.
  • the above-mentioned integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium.
  • the above-mentioned software functional unit is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (Processor) execute the method described in each embodiment of the present application Part of the steps.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例提供了一种业务平台缓存策略的测试方法及装置,本申请涉及研发管理技术领域,方法包括:设置业务平台的缓存数据库的更新间隔时间;通过预设的规则创建测试数据,并向预设的测试脚本中导入测试数据;利用测试脚本向业务平台的主数据库中导入测试数据,其中,主数据库读取测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;距第一时刻至更新间隔时间后,缓存数据库响应于缓存指令,执行测试数据的缓存操作;通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确。本申请实施例提供的技术方案能够解决现有技术中广告需求方平台的缓存策略在测试时难以判断缓存逻辑的准确性的问题。

Description

一种业务平台缓存策略的测试方法及装置
本申请要求于2019年5月21日提交中国专利局,申请号为201910421374.3、发明名称为“一种业务平台缓存策略的测试方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
【技术领域】
本申请涉及研发管理技术领域,尤其涉及一种业务平台缓存策略的测试方法及装置。
【背景技术】
广告需求方平台(Demand-Side Platform,简称DSP)是指为广告主提供跨媒介、跨平台、跨终端的的广告投放平台。其中,由投放策略和投放因子共同决定广告需求方平台的出价结果。同时,发明人发现,若广告主A在前端UI页面新增了一个投放策略,广告需求方平台竞价响应时调用的数据库未更新该新增的投放策略,那么DSP平台基于新增的投放策略无法及时对竞价请求做出响应。然而,现有的广告需求方平台的缓存策略在测试时难以判断缓存逻辑的准确性。
【申请内容】
根据本申请公开的各种实施例,提供一种业务平台缓存策略的测试方法及装置。
一种业务平台缓存策略的测试方法,所述方法包括:
设置业务平台的缓存数据库的更新间隔时间;通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据,其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
一种业务平台缓存策略的测试装置,所述装置包括:设置单元,用于设置业务平台的缓存数据库的更新间隔时间;创建单元,用于通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;导入单元,用于利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据, 其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;执行单元,用于距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;查询单元,用于通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
一种计算机非易失性存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时,实现以下方法的步骤:
设置业务平台的缓存数据库的更新间隔时间;
通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;
利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据,其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;
通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下方法步骤:
设置业务平台的缓存数据库的更新间隔时间;
通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;
利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据,其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;
通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
【附图说明】
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1是本申请实施例提供的一种可选的业务平台缓存策略的测试方法的流程图;
图2是本申请实施例提供的一种可选的业务平台缓存策略的测试装置的示意图;
图3是本申请实施例提供的一种可选的计算机设备的示意图。
【具体实施方式】
为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
应当理解,尽管在本申请实施例中可能采用术语第一、第二、第三等来描述终端,但这些终端不应限于这些术语。这些术语仅用来将终端彼此区分开。例如,在不脱离本申请实施例范围的情况下,第一获取子单元也可以被称为第二获取子单元,类似地,第二获取子单元也可以被称为第一获取子单元。
取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成 为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。
图1是根据本申请实施例的一种业务平台缓存策略的测试方法的流程图,如图1所示,该方法包括:
步骤S101,设置业务平台的缓存数据库的更新间隔时间;
步骤S102,通过预设的规则创建测试数据,并向预设的测试脚本中导入测试数据;
步骤S103,利用测试脚本向业务平台的主数据库中导入测试数据,其中,主数据库读取测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
步骤S104,距第一时刻至更新间隔时间后,缓存数据库响应于缓存指令,执行测试数据的缓存操作;
步骤S105,通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确。
业务平台例如可以是广告需求方平台(Demand-Side Platform,DSP),业务平台包括主数据库和缓存数据库,主数据库用于存储与业务平台相关的所有数据,缓存数据库用于存储策略因子。缓存数据库为redis数据库,以key-value方式存储。Redis以内存作为数据存储介质,所以读写数据的效率极高,远远超过主数据库。以设置和获取一个256字节字符串为例,它的读取速度可高达110000次/s,写速度高达81000次/s。DSP的接口每秒可能接收大量竞价请求,并且对响应的时效要求非常高,如果直接访问主数据库交互太多会导致响应时间大大增加,不能在规定的短时间内返回,那么就无法参与广告交易平台的实时竞价。这时用redis缓存的数据直接从内存读取,可以极大的提高速度和节约服务器开销。
在一种实施方式中,测试数据为SQL语句,测试脚本为python。
在本方案中,通过设置业务平台的缓存数据库的更新间隔时间,向业务平台的主数据库中导入测试数据,并将主数据库开始读取的时刻计为第一时刻;距第一时刻至更新间隔时间后,通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确。从而保障缓存策略的缓存逻辑的准确性,提高业务平台缓存策略的测试效率,以保证业务平台能够高效运行。
在一种实施方式中,缓存数据库的更新间隔时间为5秒。可以理解地,测试数据为业务平台所需的策略因子,每个策略因子与广告主ID关联;具体地,策略因子包括多个投放因子。每个广告主都会设置自己的广告投放策略,例如A广告主设置的策略因子如表1所示;
表1:A广告主的策略因子
策略因子 投放因子
流量渠道 壹账通、壹钱包、新浪门户网站
投放行业 母婴、汽车、电商、门户
投放媒介 APP、PC
时间段 2019-2-01~2019-12-30
地域 不限
广告形式 横幅广告
素材类型 图片
可选地,在距第一时刻至更新间隔时间后,缓存数据库响应于缓存指令,执行测试数据的缓存操作,包括:
将测试数据以键值对的形式存入缓存数据库,其中,测试数据包括新增策略因子、删除策略因子、更新策略因子中的至少一个策略因子,每个策略因子所关联的广告主的身份编码作为键,每个策略因子作为值。通过三种情形来测试缓存策略,能够覆盖实际应用中的策略数据的情形。
可选地,通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确,包括:
通过缓存数据库的查询接口查询广告主的身份编码;获取缓存数据库中的与身份编码关联的目标策略因子;当测试数据为新增策略因子时,判断目标策略因子与新增策略因子是否相同;如是,确认缓存数据库已存入新增策略因子,缓存逻辑正确。例如:查询“广告主A”得到的策略因子与测试数据中的广告主A关联的新增策略因子相一致,即表明缓存数据库在同步新增策略因子时的逻辑是正确的。
可选地,通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确,还包括:
通过缓存数据库的查询接口查询广告主的身份编码;获取缓存数据库中的与身份编码关联的目标策略因子;当测试数据为更新策略因子时,判断目标策略因子与更新策略因子是否相同;如是,确认缓存数据库已用更新策略因子替换与广告主的身份编码关联的原策略因子,缓存逻辑正确。例如:查询“广告主A”得到的策略因子与测试数据中的广告主A关联的更新策略因子相一致,且与更新策略因子编号相同的原策略因子已经删除,即表明缓存数据库在更新策略因子时的逻辑是正确的。
可选地,通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确,还包括:
通过缓存数据库的查询接口查询广告主的身份编码;当测试数据为删除策略因子时,判断缓存数据库中是否存在删除策略因子;当缓存数据库中不存在删除策略因子时,确认缓存数据库已经删除策略因子,缓存逻辑正确。例如:查询“广告主B”得到的策略因子中不存在与测试数据中的广告主B关联的删除策略因子相一致的策略因子,即表明缓存数据库在删除策略因子时的逻辑是正确的。
可选地,在距第一时刻至更新间隔时间后,缓存数据库响应于缓存指令,执行测试数据的缓存操作之后,方法还包括:
向业务平台输入新增策略因子,并通过业务平台的出价接口获取新增策略因子的实际出价;根据新增策略因子及预设的业务逻辑计算新增策略因子的期望出价;判断实际出价是否与期望出价相一致;若是,确认业务平台实际调用的策略因子所在的数据库为缓存数据库。
具体地,计算新增策略因子的期望出价,
X(期望出价)=P(k1*a1*b1+k2*a2*b2+....+kn*an*bn)/(k1+k2+...+kn),其中,P表示默认出价,an表示第n个策略因子,kn表示第n个策略因子的权重,bn表示第n个策略因子的匹配度。其中,策略因子的匹配度为该策略因子的投放因子的重合度。例如流量渠道的投放因子为“壹账通、壹钱包、新浪门户网站”,而实际出价采用的投放因子为“壹账通、壹钱包”,那么其匹配度为67%。那么期望匹配度100%时的出价与实际匹配度67%时的出价必然不同。
可以理解地,新增策略因子的实际出价与期望出价相同,即认为业务平台是调用的正确的新增策略因子,而该新增策略因子在距第一时刻至更新间隔时间后,已经同步至缓存数据库。如果不同,则表明业务平台是调用的策略因子是缓存数据库中的其他相似的策略因子,所以实际出价会出现偏差。
本申请实施例提供了一种业务平台缓存策略的测试装置,该装置用于执行上述业务平台缓存策略的测试方法,如图2所示,该装置包括:设置单元10、创建单元20、导入单元30、执行单元40、查询单元50。
设置单元10,用于设置业务平台的缓存数据库的更新间隔时间;
创建单元20,用于通过预设的规则创建测试数据,并向预设的测试脚本中导入测试数据;
导入单元30,用于利用测试脚本向业务平台的主数据库中导入测试数据,其中,主数据库读取测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
执行单元40,用于距第一时刻至更新间隔时间后,缓存数据库响应于缓存指令,执行测试数据的缓存操作;
查询单元50,用于通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确。
业务平台例如可以是广告需求方平台(Demand-Side Platform,DSP),业务平台包括主数据库和缓存数据库,主数据库用于存储与业务平台相关的所有数据,缓存数据库用于存储策略因子。缓存数据库为redis数据库,以key-value方式存储。Redis以内存作为数据存储介质,所以读写数据的效率极高,远远超过主数据库。以设置和获取一个256字节字符串为例,它的读取速度可高达110000次/s,写速度高达81000次/s。DSP的接口每秒可能接收大量竞价请求,并且对响应的时效要求非常高,如果直接访问主数据库交互太多会导致响应时间大大增加,不能在规定的短时间内返回,那么就无法参与广告交易平台的实时竞价。这时用redis缓存的数据直接从内存读取,可以极大的提高速度和节约服务器开销。
在一种实施方式中,测试数据为SQL语句,测试脚本为python。
在本方案中,通过设置业务平台的缓存数据库的更新间隔时间,向业务平台的主数据库中导入测试数据,并将主数据库开始读取的时刻计为第一时刻;距第一时刻至更新间隔时间后,通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确。从而保障缓存策略的缓存逻辑的准确性,提高业务平台缓存策略的测试效率,以保证业务平台能够高效运行。
在一种实施方式中,缓存数据库的更新间隔时间为5秒。可以理解地,测试数据为业务平台所需的策略因子,每个策略因子与广告主ID关联;具体地,策略因子包括多个投放因子。每个广告主都会设置自己的广告投放策略,如表1所示。
可选地,执行单元40包括执行子单元,用于将测试数据以键值对的形 式存入缓存数据库,其中,测试数据包括新增策略因子、删除策略因子、更新策略因子中的至少一个策略因子,每个策略因子所关联的广告主的身份编码作为键,每个策略因子作为值。通过三种情形来测试缓存策略,能够覆盖实际应用中的策略数据的情形。
可选地,查询单元50包括查询子单元、获取子单元、第一判断子单元、第一确认子单元。
查询子单元,用于通过缓存数据库的查询接口查询广告主的身份编码;获取子单元,用于获取缓存数据库中的与身份编码关联的目标策略因子;第一判断子单元,用于当测试数据为新增策略因子时,判断目标策略因子与新增策略因子是否相同;第一确认子单元,用于如是,确认缓存数据库已存入新增策略因子,缓存逻辑正确。例如:查询“广告主A”得到的策略因子与测试数据中的广告主A关联的新增策略因子相一致,即表明缓存数据库在同步新增策略因子时的逻辑是正确的。
可选地,查询单元50还包括第二判断子单元、第二确认子单元。
第二判断子单元,用于当测试数据为更新策略因子时,判断目标策略因子与更新策略因子是否相同;第二确认子单元,用于如是,确认缓存数据库已用更新策略因子替换与广告主的身份编码关联的原策略因子,缓存逻辑正确。例如:查询“广告主A”得到的策略因子与测试数据中的广告主A关联的更新策略因子相一致,且与更新策略因子编号相同的原策略因子已经删除,即表明缓存数据库在更新策略因子时的逻辑是正确的。
可选地,查询单元50还包括第三判断子单元、第三确认子单元。
第三判断子单元,用于当测试数据为删除策略因子时,判断缓存数据库中是否存在删除策略因子;第三确认子单元,用于当缓存数据库中不存在删除策略因子时,确认缓存数据库已经删除策略因子,缓存逻辑正确。例如:查询“广告主B”得到的策略因子中不存在与测试数据中的广告主B关联的删除策略因子相一致的策略因子,即表明缓存数据库在删除策略因子时的逻辑是正确的。
可选地,装置还包括输入单元、计算单元、判断单元、确认单元。
输入单元,用于向业务平台输入新增策略因子,并通过业务平台的出价接口获取新增策略因子的实际出价;计算单元,用于根据新增策略因子及预设的业务逻辑计算新增策略因子的期望出价;判断单元,用于判断实际出价是否与期望出价相一致;确认单元,用于若是,确认业务平台实际调用的策略因子所在的数据库为缓存数据库。
具体地,计算新增策略因子的期望出价,
X(期望出价)=P(k1*a1*b1+k2*a2*b2+....+kn*an*bn)/(k1+k2+...+kn), 其中,P表示默认出价,an表示第n个策略因子,kn表示第n个策略因子的权重,bn表示第n个策略因子的匹配度。其中,策略因子的匹配度为该策略因子的投放因子的重合度。例如流量渠道的投放因子为“壹账通、壹钱包、新浪门户网站”,而实际出价采用的投放因子为“壹账通、壹钱包”,那么其匹配度为67%。那么期望匹配度100%时的出价与实际匹配度67%时的出价必然不同。
可以理解地,新增策略因子的实际出价与期望出价相同,即认为业务平台是调用的正确的新增策略因子,而该新增策略因子在距第一时刻至更新间隔时间后,已经同步至缓存数据库。如果不同,则表明业务平台是调用的策略因子是缓存数据库中的其他相似的策略因子,所以实际出价会出现偏差。
本申请实施例提供了一种计算机非易失性存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行以下步骤:
设置业务平台的缓存数据库的更新间隔时间;通过预设的规则创建测试数据,并向预设的测试脚本中导入测试数据;利用测试脚本向业务平台的主数据库中导入测试数据,其中,主数据库读取测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;距第一时刻至更新间隔时间后,缓存数据库响应于缓存指令,执行测试数据的缓存操作;通过缓存数据库的查询接口查询测试数据,以判断缓存数据库的缓存逻辑是否正确。
可选地,在程序运行时控制存储介质所在设备执行以下步骤:将测试数据以键值对的形式存入缓存数据库,其中,测试数据包括新增策略因子、删除策略因子、更新策略因子中的至少一个策略因子,每个策略因子所关联的广告主的身份编码作为键,每个策略因子作为值。
可选地,在程序运行时控制存储介质所在设备执行以下步骤:通过缓存数据库的查询接口查询广告主的身份编码;获取缓存数据库中的与身份编码关联的目标策略因子;当测试数据为新增策略因子时,判断目标策略因子与新增策略因子是否相同;如是,确认缓存数据库已存入新增策略因子,缓存逻辑正确。
可选地,在程序运行时控制存储介质所在设备执行以下步骤:通过缓存数据库的查询接口查询广告主的身份编码;获取缓存数据库中的与身份编码关联的目标策略因子;当测试数据为更新策略因子时,判断目标策略因子与更新策略因子是否相同;如是,确认缓存数据库已用更新策略因子替换与广告主的身份编码关联的原策略因子,缓存逻辑正确。
可选地,在程序运行时控制存储介质所在设备执行以下步骤:通过缓 存数据库的查询接口查询广告主的身份编码;当测试数据为删除策略因子时,判断缓存数据库中是否存在删除策略因子;当缓存数据库中不存在删除策略因子时,确认缓存数据库已经删除策略因子,缓存逻辑正确。
前述计算机存储介质可以是非易失性的,也可以是易失性的。领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
图3是本申请实施例提供的一种计算机设备的示意图。如图3所示,该实施例的计算机设备100包括:处理器101、存储器102以及存储在存储器102中并可在处理器101上运行的计算机程序103,该计算机程序103被处理器101执行时实现实施例中的业务平台缓存策略的测试方法,为避免重复,此处不一一赘述。或者,该计算机程序被处理器101执行时实现实施例中业务平台缓存策略的测试装置中各模型/单元的功能,为避免重复,此处不一一赘述。
计算机设备100可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。计算机设备可包括,但不仅限于,处理器101、存储器102。本领域技术人员可以理解,图3仅仅是计算机设备100的示例,并不构成对计算机设备100的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器101可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器102可以是计算机设备100的内部存储单元,例如计算机设备100的硬盘或内存。存储器102也可以是计算机设备100的外部存储设备,例如计算机设备100上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器102还可以既包括计算机设备100的内部存储单元也包括外部存储设备。存储器102用于存储计算机程序以 及计算机设备所需的其他程序和数据。存储器102还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)或处理器(Processor)执行本申请各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (20)

  1. 一种业务平台缓存策略的测试方法,所述方法包括:
    设置业务平台的缓存数据库的更新间隔时间;
    通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;
    利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据,其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
    距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;
    通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
  2. 根据权利要求1所述的方法,其中,在所述距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作,包括:
    将所述测试数据以键值对的形式存入所述缓存数据库,其中,所述测试数据包括新增策略因子、删除策略因子、更新策略因子中的至少一个策略因子,每个所述策略因子所关联的广告主的身份编码作为键,每个所述策略因子作为值。
  3. 根据权利要求2所述的方法,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    获取所述缓存数据库中的与所述身份编码关联的目标策略因子;
    当所述测试数据为所述新增策略因子时,判断所述目标策略因子与所述新增策略因子是否相同;
    如是,确认所述缓存数据库已存入所述新增策略因子,缓存逻辑正确。
  4. 根据权利要求2所述的方法,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,还包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    获取所述缓存数据库中的与所述身份编码关联的目标策略因子;
    当所述测试数据为所述更新策略因子时,判断所述目标策略因子与所述更新策略因子是否相同;
    如是,确认所述缓存数据库已用所述更新策略因子替换与所述广告主 的身份编码关联的原策略因子,缓存逻辑正确。
  5. 根据权利要求2所述的方法,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,还包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    当所述测试数据为所述删除策略因子时,判断所述缓存数据库中是否存在所述删除策略因子;
    当所述缓存数据库中不存在所述删除策略因子时,确认所述缓存数据库已经删除所述策略因子,缓存逻辑正确。
  6. 根据权利要求2所述的方法,其中,在所述距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作之后,所述方法还包括:
    向所述业务平台输入所述新增策略因子,并通过所述业务平台的出价接口获取所述新增策略因子的实际出价;
    根据所述新增策略因子及预设的业务逻辑计算所述新增策略因子的期望出价;
    判断所述实际出价是否与所述期望出价相一致;
    若是,确认所述业务平台实际调用的策略因子所在的数据库为所述缓存数据库。
  7. 一种业务平台缓存策略的测试装置,其中,所述装置包括:
    设置单元,用于设置业务数据平台的缓存数据库的更新间隔时间;
    创建单元,用于通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;
    导入单元,用于利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据,其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
    执行单元,用于距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;
    查询单元,用于通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
  8. 根据权利要求7所述的装置,其中,所述执行单元包括:
    执行子单元,用于将所述测试数据以键值对的形式存入所述缓存数据库,其中,所述测试数据包括新增策略因子、删除策略因子、更新策略因子中的至少一个策略因子,每个所述策略因子所关联的广告主的身份编码作为键,每个所述策略因子作为值。
  9. 一种计算机非易失性存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时,实现以下方法的步骤:
    设置业务平台的缓存数据库的更新间隔时间;
    通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;
    利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据,其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
    距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;
    通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
  10. 根据权利要求9所述存储介质,其中,在所述距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作,包括:
    将所述测试数据以键值对的形式存入所述缓存数据库,其中,所述测试数据包括新增策略因子、删除策略因子、更新策略因子中的至少一个策略因子,每个所述策略因子所关联的广告主的身份编码作为键,每个所述策略因子作为值。
  11. 根据权利要求10所述存储介质,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    获取所述缓存数据库中的与所述身份编码关联的目标策略因子;
    当所述测试数据为所述新增策略因子时,判断所述目标策略因子与所述新增策略因子是否相同;
    如是,确认所述缓存数据库已存入所述新增策略因子,缓存逻辑正确。
  12. 根据权利要10所述存储介质,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,还包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    获取所述缓存数据库中的与所述身份编码关联的目标策略因子;
    当所述测试数据为所述更新策略因子时,判断所述目标策略因子与所述更新策略因子是否相同;
    如是,确认所述缓存数据库已用所述更新策略因子替换与所述广告主 的身份编码关联的原策略因子,缓存逻辑正确。
  13. 根据权利要求10所述存储介质,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,还包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    当所述测试数据为所述删除策略因子时,判断所述缓存数据库中是否存在所述删除策略因子;
    当所述缓存数据库中不存在所述删除策略因子时,确认所述缓存数据库已经删除所述策略因子,缓存逻辑正确。
  14. 根据权利要求10所述存储介质,其中,在所述距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作之后,所述方法还包括:
    向所述业务平台输入所述新增策略因子,并通过所述业务平台的出价接口获取所述新增策略因子的实际出价;
    根据所述新增策略因子及预设的业务逻辑计算所述新增策略因子的期望出价;
    判断所述实际出价是否与所述期望出价相一致;
    若是,确认所述业务平台实际调用的策略因子所在的数据库为所述缓存数据库。
  15. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下方法的步骤。
    设置业务平台的缓存数据库的更新间隔时间;
    通过预设的规则创建测试数据,并向预设的测试脚本中导入所述测试数据;
    利用所述测试脚本向所述业务平台的主数据库中导入所述测试数据,其中,所述主数据库读取所述测试数据后生成缓存指令,并将开始读取的时刻计为第一时刻;
    距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作;
    通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确。
  16. 根据权利要求15所述的计算机设备,其中,在所述距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作,包括:
    将所述测试数据以键值对的形式存入所述缓存数据库,其中,所述测试数据包括新增策略因子、删除策略因子、更新策略因子中的至少一个策略因子,每个所述策略因子所关联的广告主的身份编码作为键,每个所述策略因子作为值。
  17. 根据权利要求16所述的计算机设备,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    获取所述缓存数据库中的与所述身份编码关联的目标策略因子;
    当所述测试数据为所述新增策略因子时,判断所述目标策略因子与所述新增策略因子是否相同;
  18. 根据权利要求16所述的计算机设备,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,还包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    获取所述缓存数据库中的与所述身份编码关联的目标策略因子;
    当所述测试数据为所述更新策略因子时,判断所述目标策略因子与所述更新策略因子是否相同;
    如是,确认所述缓存数据库已用所述更新策略因子替换与所述广告主的身份编码关联的原策略因子,缓存逻辑正确。
  19. 根据权利要求16所述的计算机设备,其中,所述通过所述缓存数据库的查询接口查询所述测试数据,以判断所述缓存数据库的缓存逻辑是否正确,还包括:
    通过所述缓存数据库的查询接口查询所述广告主的身份编码;
    当所述测试数据为所述删除策略因子时,判断所述缓存数据库中是否存在所述删除策略因子;
    当所述缓存数据库中不存在所述删除策略因子时,确认所述缓存数据库已经删除所述策略因子,缓存逻辑正确。
  20. 根据权利要求16所述的计算机设备,其中,在所述距所述第一时刻至所述更新间隔时间后,所述缓存数据库响应于所述缓存指令,执行所述测试数据的缓存操作之后,所述方法还包括:
    向所述业务平台输入所述新增策略因子,并通过所述业务平台的出价接口获取所述新增策略因子的实际出价;
    根据所述新增策略因子及预设的业务逻辑计算所述新增策略因子的期望出价;
    判断所述实际出价是否与所述期望出价相一致;
    若是,确认所述业务平台实际调用的策略因子所在的数据库为所述缓存数据库。
PCT/CN2020/087741 2019-05-21 2020-04-29 一种业务平台缓存策略的测试方法及装置 WO2020233374A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910421374.3A CN110347545A (zh) 2019-05-21 2019-05-21 一种业务平台缓存策略的测试方法及装置
CN201910421374.3 2019-05-21

Publications (1)

Publication Number Publication Date
WO2020233374A1 true WO2020233374A1 (zh) 2020-11-26

Family

ID=68173950

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/087741 WO2020233374A1 (zh) 2019-05-21 2020-04-29 一种业务平台缓存策略的测试方法及装置

Country Status (2)

Country Link
CN (1) CN110347545A (zh)
WO (1) WO2020233374A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685275A (zh) * 2020-12-30 2021-04-20 北京迈格威科技有限公司 算法策略搜索方法、装置、电子设备及存储介质
CN112965905A (zh) * 2021-03-11 2021-06-15 京东数科海益信息科技有限公司 数据测试方法、装置、设备及存储介质
CN113806651A (zh) * 2021-09-18 2021-12-17 深圳市酷开网络科技股份有限公司 一种数据缓存方法、装置、服务器及存储介质
CN117251383A (zh) * 2023-11-17 2023-12-19 深圳开源互联网安全技术有限公司 基于缓存的软件成分检测方法、装置、设备及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347545A (zh) * 2019-05-21 2019-10-18 深圳壹账通智能科技有限公司 一种业务平台缓存策略的测试方法及装置
CN110929195B (zh) * 2019-11-21 2023-03-24 望海康信(北京)科技股份公司 数据的缓存策略确定方法、装置以及电子设备
CN111078768A (zh) * 2019-11-25 2020-04-28 深圳壹账通智能科技有限公司 基于图形数据库的数据导入方法、系统和可读存储介质
CN112241369B (zh) * 2020-10-16 2022-06-21 四川长虹电器股份有限公司 基于python的接口自动化测试方法
CN112818019B (zh) * 2021-01-29 2024-02-02 北京思特奇信息技术股份有限公司 一种应用于Redis客户端的查询请求过滤方法及Redis客户端

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070088714A1 (en) * 2005-10-19 2007-04-19 Edwards Gregory T Methods and apparatuses for collection, processing, and utilization of viewing data
CN105740383A (zh) * 2016-01-27 2016-07-06 中国科学院计算技术研究所 一种大数据平台下数据库与缓存的数据一致性方法及系统
CN107391359A (zh) * 2016-05-17 2017-11-24 腾讯科技(深圳)有限公司 一种业务测试方法及装置
CN108829584A (zh) * 2018-05-24 2018-11-16 携程计算机技术(上海)有限公司 业务逻辑接口mock测试方法及系统
CN110347545A (zh) * 2019-05-21 2019-10-18 深圳壹账通智能科技有限公司 一种业务平台缓存策略的测试方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902730B (zh) * 2012-09-10 2016-04-20 新浪网技术(中国)有限公司 基于数据缓存的读数据方法及装置
EP2975535A1 (en) * 2014-07-14 2016-01-20 Fujitsu Limited Checking freshness of data for a data integration system, DIS
CN105975352B (zh) * 2016-04-28 2019-08-30 努比亚技术有限公司 一种缓存数据处理方法及服务器
CN106294607A (zh) * 2016-07-29 2017-01-04 北京奇虎科技有限公司 缓存数据的更新方法及更新装置
CN106682193B (zh) * 2016-12-29 2021-01-08 北京奇虎科技有限公司 基于缓存的数据持久化存储方法及装置
CN107704573A (zh) * 2017-09-30 2018-02-16 山东浪潮通软信息科技有限公司 一种与业务耦合的智能缓存方法
CN109582895A (zh) * 2018-12-04 2019-04-05 山东浪潮通软信息科技有限公司 一种缓存实现方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070088714A1 (en) * 2005-10-19 2007-04-19 Edwards Gregory T Methods and apparatuses for collection, processing, and utilization of viewing data
CN105740383A (zh) * 2016-01-27 2016-07-06 中国科学院计算技术研究所 一种大数据平台下数据库与缓存的数据一致性方法及系统
CN107391359A (zh) * 2016-05-17 2017-11-24 腾讯科技(深圳)有限公司 一种业务测试方法及装置
CN108829584A (zh) * 2018-05-24 2018-11-16 携程计算机技术(上海)有限公司 业务逻辑接口mock测试方法及系统
CN110347545A (zh) * 2019-05-21 2019-10-18 深圳壹账通智能科技有限公司 一种业务平台缓存策略的测试方法及装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685275A (zh) * 2020-12-30 2021-04-20 北京迈格威科技有限公司 算法策略搜索方法、装置、电子设备及存储介质
CN112965905A (zh) * 2021-03-11 2021-06-15 京东数科海益信息科技有限公司 数据测试方法、装置、设备及存储介质
CN113806651A (zh) * 2021-09-18 2021-12-17 深圳市酷开网络科技股份有限公司 一种数据缓存方法、装置、服务器及存储介质
CN113806651B (zh) * 2021-09-18 2024-05-24 深圳市酷开网络科技股份有限公司 一种数据缓存方法、装置、服务器及存储介质
CN117251383A (zh) * 2023-11-17 2023-12-19 深圳开源互联网安全技术有限公司 基于缓存的软件成分检测方法、装置、设备及存储介质
CN117251383B (zh) * 2023-11-17 2024-03-22 深圳开源互联网安全技术有限公司 基于缓存的软件成分检测方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN110347545A (zh) 2019-10-18

Similar Documents

Publication Publication Date Title
WO2020233374A1 (zh) 一种业务平台缓存策略的测试方法及装置
CN109299164B (zh) 一种数据查询方法、计算机可读存储介质及终端设备
TWI605400B (zh) Information pushing method, device and system
CN105827706B (zh) 消息推送装置及方法
WO2022127543A1 (zh) 广告信息处理方法、装置、设备和存储介质
WO2018036272A1 (zh) 新闻内容的推送方法、电子装置及计算机可读存储介质
US10122811B2 (en) Method for determining identities between users
CN109213598B (zh) 一种资源分配方法、装置及计算机可读存储介质
WO2020177384A1 (zh) 消息推送的用户消息状态上报处理方法、装置及存储介质
US9514217B2 (en) Message index subdivided based on time intervals
CN110196848B (zh) 一种面向公共资源交易数据的清洗去重方法及其系统
US11886503B2 (en) Method and apparatus for implementing a search index generator
TW201319982A (zh) 產品資訊的即時去重複方法和裝置
US20200089720A1 (en) Delivery of contextual content using blockchain data
CN113450162A (zh) 用户分群方法、装置及存储介质
US20210357458A1 (en) Generating near real-time notifications using an asynchronous matching system
US20150287096A1 (en) Bid control through semantic signals expressed in natural language
US20210374339A1 (en) Generating sentiment analysis of content
US9298786B1 (en) Deferred content presentation
EP3374942A1 (en) Response latency reduction in fixed allocation content selection infrastructure
CN110704486A (zh) 数据处理方法、装置、系统、存储介质和服务器
US20190066154A1 (en) Escrow Agent for Conversion Verification
CN112328592A (zh) 数据存储方法、电子设备及计算机可读存储介质
CN103870951A (zh) 一种物流信息管理网络系统
US20220083507A1 (en) Trust chain for official data and documents

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20808770

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 040322)

122 Ep: pct application non-entry in european phase

Ref document number: 20808770

Country of ref document: EP

Kind code of ref document: A1