WO2019019393A1 - 业务接口调用方法、装置、用户终端和可读存储介质 - Google Patents

业务接口调用方法、装置、用户终端和可读存储介质 Download PDF

Info

Publication number
WO2019019393A1
WO2019019393A1 PCT/CN2017/104838 CN2017104838W WO2019019393A1 WO 2019019393 A1 WO2019019393 A1 WO 2019019393A1 CN 2017104838 W CN2017104838 W CN 2017104838W WO 2019019393 A1 WO2019019393 A1 WO 2019019393A1
Authority
WO
WIPO (PCT)
Prior art keywords
difficulty coefficient
preset
workload difficulty
server
workload
Prior art date
Application number
PCT/CN2017/104838
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 WO2019019393A1 publication Critical patent/WO2019019393A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a service interface calling method, apparatus, user terminal, and readable storage medium.
  • the manual operation is recognized by the Turing test method. Only the manual operation through the Turing test can call the corresponding service interface, and the request server returns the corresponding business result.
  • the Turing test has a low accuracy rate for identifying such operations, so that the operation of human operations and automation software cannot be accurately distinguished, resulting in the abuse of automation software. The case of the business interface.
  • a service interface invocation method, apparatus, user terminal, and readable storage medium are provided that address one or more of the problems involved in the background.
  • a method of calling a business interface comprising:
  • the service interface of the user terminal is invoked to send the service data to the server.
  • a service interface calling device includes:
  • An obtaining module configured to obtain input business data, and obtain an input workload proof instruction corresponding to the service data
  • a sending module configured to send a preset workload difficulty coefficient acquisition request to the server
  • a receiving module configured to receive a preset workload difficulty coefficient corresponding to the workload proof instruction returned by the server according to the preset workload difficulty coefficient acquisition request;
  • a calculation module configured to calculate a current workload difficulty coefficient according to the service data and the preset workload difficulty coefficient
  • the calling module is configured to: when the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient, invoke a service interface of the user terminal to send the service data to the server.
  • a user terminal includes a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the following steps:
  • the service interface of the user terminal is invoked to send the service data to the server.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the following steps:
  • the service interface of the user terminal is invoked to send the service data to the server.
  • FIG. 1 is an application scenario diagram of a method for calling a service interface in an embodiment
  • FIG. 2 is a flowchart of a method for calling a service interface in an embodiment
  • FIG. 3 is a sequence diagram of a method for calling a service interface in an embodiment
  • FIG. 4 is a schematic diagram of a service interface calling device in an embodiment
  • FIG. 5 is a schematic diagram of a service interface calling device in another embodiment
  • FIG. 6 is a schematic structural diagram of a user terminal in an embodiment.
  • FIG. 1 is an application scenario diagram of a method for calling a service interface in an embodiment, which includes a service terminal and a server, and the service terminal can communicate with a server.
  • the user performs service processing through the service terminal, and then the service terminal sends the service data obtained by the service processing to the server, so as to obtain the processing result corresponding to the service data from the server.
  • the service terminal can be a user's computer, mobile phone, tablet computer, and the like.
  • a service interface calling method is provided. This embodiment is applied to the service terminal in FIG. 1 to illustrate.
  • the service terminal runs a business interface calling program, and the business interface calling method is used to implement the business interface calling method.
  • the method specifically includes the following steps:
  • the service terminal can provide a service form display interface, so that the user can input corresponding service data to the service terminal through the service form display interface.
  • a service form display interface For example, when the login page is used as a business form, an input box for the user account and the user password is displayed, and the user can input the user account and the user password through the input box, and the user account and the user password are the service data here.
  • the query page is used as a business form, for example, a query page of the browser, a search box is displayed thereon, and the user can input a keyword of the content to be searched through the search box, and the keyword is here.
  • Business data for example, a query page of the browser, a search box is displayed thereon, and the user can input a keyword of the content to be searched through the search box, and the keyword is here.
  • the workload proof instruction is an instruction input by the user to the user terminal, which is to indicate to the user terminal that the user terminal is not currently using the automation software.
  • a button may be set on the display interface of the user terminal, for example, “I am not a robot” button or “I am not a robot” button, when the user clicks the button, a workload proof corresponding to the business data is generated. instruction.
  • the user terminal in order to calculate the current workload difficulty coefficient, starts a lightweight session, and sends a preset workload difficulty coefficient acquisition request to the server to obtain a preset workload difficulty coefficient stored in the server.
  • Obtaining the preset workload difficulty coefficient from the server is to prevent the user terminal from calculating the current workload difficulty coefficient only according to the content stored by itself, and if the user terminal only calculates the current workload difficulty coefficient according to the content stored by itself, the user terminal can arbitrarily change Data, or do not change the data, directly send the last workload difficulty coefficient to the server. Since the server also calculates the current workload difficulty coefficient according to the data sent by the user terminal, the server cannot accurately determine the current workload calculated by the user terminal. The difficulty factor is correct, which makes the user terminal extremely vulnerable to illegal use.
  • the receiving server acquires a preset workload difficulty coefficient corresponding to the workload proof instruction returned according to the preset workload difficulty coefficient.
  • the server when the server receives the preset workload difficulty coefficient acquisition request, according to the The request query is related to the preset workload difficulty coefficient corresponding to the workload proof instruction.
  • the server may store a table, where the correspondence between the workload proof instruction and the preset workload difficulty coefficient is stored, and the server may prove according to the workload.
  • the instruction queries the corresponding preset workload difficulty coefficient.
  • the current workload difficulty coefficient is calculated according to the service data stored in the user terminal and the preset workload difficulty coefficient returned by the server, so that The data is used to calculate the current workload difficulty coefficient, which can prevent the user terminal from being used by software such as automation.
  • the automation software uses the user terminal, it generally performs batch processing for the business, and thus calculates the current workload difficulty coefficient in batches, so The corresponding preset workload difficulty coefficient is obtained from the server in batches, which is relatively difficult to implement for batch processing, which is highly likely to cause confusion in the processing process, thereby causing service processing failure.
  • the current workload difficulty coefficient when the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient, it indicates that the user terminal needs to consume a certain amount of work when processing the current service, so it is not an automation software, so that the corresponding service interface can be invoked.
  • the server sends business data. If the workload proof mechanism is not used to prove that the user terminal is processing a current service, it requires a certain amount of work. For example, when using automation software to process the current service, the service interface is always occupied by the automation software, resulting in real need to use. The service of the service interface cannot be processed normally, resulting in the abuse of the service interface.
  • the foregoing service security calling method considers that the service data is manually operated only when the current workload difficulty coefficient calculated by the service data and the preset workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient obtained from the server. Generated, so that the corresponding business interface is called to send business data to the server, but if the automation software is used to process the processing, since the automation software is processing in a batch processing manner, the corresponding work cannot be input to the terminal in batches.
  • the difficulty proves the instruction, so that the service data cannot be sent to the server through the service interface, and the service interface is prevented from being abused by the automation software.
  • the step of calculating the current workload difficulty coefficient according to the service data and the preset workload difficulty coefficient may include: obtaining a session identifier corresponding to the preset workload difficulty coefficient acquisition request from the server;
  • the sorting combination method sorts and combines the business data, the preset workload difficulty coefficient, and the session identifier to obtain combined data; performs message digest calculation on the combined data to obtain a hash value; and obtains the position of the preset character in the hash value as the current workload. degree of difficulty.
  • the session identifier refers to the session identifier of the user terminal and the server acquiring the preset workload difficulty coefficient session, which is generally a random number, such as 0, 1, 2, 3, 4, and the like.
  • the preset sorting combination mode is a sorting combination method agreed by the server and the user terminal.
  • the service data is ranked before the preset workload difficulty coefficient
  • the preset workload difficulty coefficient is ranked before the session identifier
  • the service data is ranked before the session identifier.
  • the session identifier is ranked before the preset workload difficulty coefficient, and the specific manner of the sorting is not limited herein, as long as the user terminal and the server are consistent in the manner of the sorting.
  • the message digest calculation can be calculated by the MD5 algorithm or other message digest calculation methods.
  • the step of obtaining the position of the preset character in the hash value as the current workload difficulty coefficient may include: converting the hash value into a binary character; acquiring the first non-zero one of the binary characters The position is the current workload difficulty factor.
  • the current workload difficulty coefficient is obtained according to the hash value calculated by the service data, the preset workload difficulty coefficient, and the combined data formed by the session identifier, and in order to facilitate the conversion of the hash value into a binary character, In other embodiments, it can also be converted into decimal characters, hexadecimal characters, and the like.
  • the preset character can be 1 or 0.
  • the converted binary characters can be arranged from left to right to obtain the first non-zero of the binary characters.
  • the first one that is, the position where the first one is located is used as the current workload difficulty coefficient. For example, when the binary character is "0000000101000101", the current workload difficulty coefficient is 8, because the first one is ranked in the eighth position.
  • the method for calling the service interface may further include: when the current workload difficulty coefficient is less than the preset workload difficulty coefficient, adjusting the session identifier according to the preset step size, and working according to the service data and the preset Volume difficulty factor and adjusted session ID calculate current work The amount of difficulty coefficient until the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient.
  • the session identifier may be adjusted.
  • the preset step size may be 1. 2, 3, 6, etc.
  • the adjustment session identifier is 1, and then the current workload difficulty coefficient when the session identifier is 1 is calculated until the current workload difficulty coefficient is greater than or equal to the preset workload.
  • the service interface of the user terminal is called to send corresponding service data to the server.
  • the service interface calling method may further include: invoking a service interface of the user terminal to send a current workload difficulty coefficient to the server, so that the server calculates the target workload difficulty coefficient according to the service data and the preset work difficulty coefficient;
  • the business interface receiving server receives the service data processing result corresponding to the service data returned by the service interface of the server when the current workload difficulty coefficient is consistent with the target workload difficulty coefficient.
  • the user terminal invokes the service interface of the user terminal to send the current workload difficulty coefficient and the service data to the server, and the server first queries the preset workload difficulty coefficient stored by the server, and then according to the stored preset workload difficulty coefficient and the service.
  • the data calculates the target workload difficulty coefficient in the same way as the user terminal. Only when the target workload difficulty coefficient is the same as the current workload difficulty coefficient sent by the user terminal, the server will invoke the server response service interface to return to the user terminal. The processing result corresponding to the business data.
  • FIG. 3 is a sequence diagram of a service interface invocation method in an embodiment.
  • the user terminal b needs to request a service interface i of the server s through the service interface a of the user terminal b.
  • Data such as querying current foreign exchange rate business.
  • the user terminal provides a user form interface, which includes a user name Username, a password Password, and a forexTag for the foreign exchange symbol, and a workload proof instruction button "I am not a robot".
  • a user form interface which includes a user name Username, a password Password, and a forexTag for the foreign exchange symbol, and a workload proof instruction button "I am not a robot”.
  • Clicking the workload proof command button so that the user terminal requests a current workload proof instruction, that is, a preset workload difficulty coefficient corresponding to the current service data, and the server receives the preset workload difficulty coefficient acquisition request, Will return a preset workload difficulty coefficient to the user terminal and the session of the session Identification, assuming that the preset workload has a difficulty factor of 7, and the session ID is zero.
  • the user terminal calculates the current workload difficulty coefficient according to the preset workload difficulty coefficient returned by the server, the session identifier of the session, and the service data.
  • the business data includes the username Username, password Password, and the forex symbol forexTag.
  • the user terminal arranges and combines the preset workload difficulty coefficient, the session identifier of the session, and the service data as follows:
  • difficulty represents the default working difficulty coefficient
  • forextag represents the foreign exchange symbol
  • nonce represents the random number
  • password represents the password
  • sid represents the security identifier
  • group and computer account is the unique number identifying the user
  • username represents the user name.
  • the hash value can be calculated by the SHA256 message digest, that is, the hash value: 5285ea9f915b1238822ec0529f6aa7600adf23a6438858d62d278a515fe89ca9.
  • the hash value is arranged from left to right and then converted into binary characters.
  • the current work volume difficulty coefficient can be defined as 5. If the preset workload difficulty coefficient is 7, the current workload difficulty coefficient does not satisfy the preset workload difficulty coefficient.
  • the session identifier nonce value is incremented according to the preset step size to obtain new combined data:
  • the hash value is obtained as follows:
  • the current workload difficulty coefficient is 7, which is equal to the preset workload difficulty coefficient, so the combined data and the hash value are submitted to the server:
  • the server parses the combined data and the hash value to obtain a hash value and a combined data:
  • Hash 01db19b5af692ea1831dc2a499ac05cf32c3d30106d292f0dd60a181c8d5f364 and
  • the server can then calculate the target hash value once based on the combined data (which includes the preset workload difficulty factor and the business data):
  • Hash’ 01db19b5af692ea1831dc2a499ac05cf32c3d30106d292f0dd60a181c8d5f364
  • the server service interface can be invoked to process the corresponding service data to the user terminal to prevent the server service interface from being abused.
  • the server may calculate the target hash value once according to the combined data, and may first obtain the preset workload difficulty coefficient according to the combined data and compare it with the locally stored preset workload difficulty coefficient, as long as the two are the same. In the next step, or directly obtain the workload difficulty coefficient of the local storage and the business data and the session identifier in the combined data to re-form the combined data, for example, sorting and combining according to the same sorting combination as the user terminal, and then obtaining the combined data, and then calculating
  • the target hash value is obtained according to the target hash value, and when the target workload difficulty coefficient is consistent with the current workload difficulty coefficient submitted by the user terminal, the user terminal is a session obtained through a large number of computational searches.
  • the identifier is further obtained with a hash value satisfying the preset workload difficulty coefficient, so that the request is legal, so the server can invoke the server service interface and the processing result corresponding to the service data returned by the user terminal to prevent the server service interface from being abused.
  • steps in the flowcharts of FIGS. 2 and 3 above are displayed once in accordance with the indication of the arrow, these steps are not necessarily performed once in the order indicated by the arrows. Unless explicitly stated in this article As stated, the execution of these steps is not strictly sequential, and can be performed in other orders. Moreover, at least some of the steps in FIG. 2 and FIG. 3 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, and the execution order thereof is also It is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of the other steps.
  • FIG. 4 is a schematic diagram of a service interface calling device in an embodiment, where the service interface calling device includes:
  • the obtaining module 110 is configured to obtain the input service data, and obtain the input workload proof instruction corresponding to the service data.
  • the sending module 120 is configured to send a preset workload difficulty coefficient acquisition request to the server.
  • the receiving module 130 is configured to receive a preset workload difficulty coefficient corresponding to the workload proof instruction returned by the server according to the preset workload difficulty coefficient acquisition request.
  • the calculation module 140 is configured to calculate a current workload difficulty coefficient according to the service data and the preset workload difficulty coefficient.
  • the calling module 150 is configured to: when the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient, invoke the service interface of the user terminal to send the service data to the server.
  • FIG. 5 is a schematic diagram of a service interface calling device in another embodiment, where the computing module 140 may include:
  • the session identifier obtaining unit 141 is configured to acquire, from the server, a session identifier corresponding to the preset workload difficulty coefficient acquisition request.
  • the combining unit 142 is configured to perform the sorting combination of the service data, the preset workload difficulty coefficient, and the session identifier according to a preset sorting combination manner to obtain combined data.
  • the hash value calculation unit 143 is configured to perform a message digest calculation on the combined data to obtain a hash value.
  • the current workload difficulty coefficient obtaining unit 144 is configured to obtain the position of the preset character in the hash value as the current workload difficulty coefficient.
  • the current workload difficulty coefficient obtaining unit 144 may include:
  • the converting unit 1441 is configured to convert the hash value into a binary character.
  • the location obtaining unit 1442 is configured to obtain a location of the first non-zero one of the binary characters as the current workload difficulty coefficient.
  • the calling module 150 is further configured to: when the current workload difficulty coefficient is less than the preset workload difficulty coefficient, adjust the session identifier according to the preset step size, and according to the service data, the preset workload difficulty coefficient. And the adjusted session identifier calculates the current workload difficulty coefficient until the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient.
  • the calling module 150 may be further configured to invoke a service interface of the user terminal to send a current workload difficulty coefficient to the server, so that the server calculates the target workload difficulty coefficient according to the service data and the preset working difficulty coefficient; The service receiving result of the service data corresponding to the service data returned by the interface receiving server through the service interface of the server when the current workload difficulty coefficient is consistent with the target workload difficulty coefficient.
  • the above limitation on the service interface calling device may participate in the above definition of the service interface calling method, and details are not described herein again.
  • the various modules in the webpage data crawler described above may be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
  • the above business interface invoking device can be implemented in the form of a computer program that can be run at a user terminal as shown in FIG.
  • FIG. 6 is a schematic structural diagram of a user terminal in an embodiment, where the user terminal includes a memory, a processor, and an operating system connected through a system bus, where the processor is used to provide computing and control capabilities, and supports the entire computer. The operation of the device.
  • the memory is used to store data, program code, and the like.
  • At least one computer executable program is stored on the memory, the computer executable program being executable by the processor to implement the service interface calling method provided in the embodiments of the present application.
  • the computer The executable program can be executed by the processor for implementing a service interface calling method provided by the various embodiments described above.
  • the internal memory in the user terminal provides a cached operating environment for the operating system, databases, and computer executables in the non-volatile storage medium.
  • the processor implements the following steps: obtaining the input service data; obtaining the input workload proof instruction corresponding to the service data; sending the preset workload difficulty coefficient acquisition request to the server; and receiving the server according to the preset workload difficulty
  • the coefficient acquisition request returns a preset workload difficulty coefficient corresponding to the workload proof instruction; the current workload difficulty coefficient is calculated according to the service data and the preset workload difficulty coefficient; when the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient.
  • the service interface of the user terminal is called to send the service data to the server.
  • the processor when the processor executes the program, the following steps may be implemented: obtaining, from the server, a session identifier corresponding to the preset workload difficulty coefficient acquisition request; and the service data and the preset workload according to the preset sorting combination manner The difficulty coefficient and the session identifier are sorted and combined to obtain combined data; the message summary is calculated for the combined data to obtain a hash value; and the position of the preset character in the hash value is obtained as the current workload difficulty coefficient.
  • the processor may also implement the following steps: converting the hash value to a binary character; and obtaining the position of the first non-zero one of the binary characters as the current workload difficulty coefficient.
  • the processor executes the program, the following steps may be implemented: when the current workload difficulty coefficient is less than the preset workload difficulty coefficient, the session identifier is adjusted according to the preset step size, and according to the service data, the preset The workload difficulty coefficient and the adjusted session identifier calculate the current workload difficulty coefficient until the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient.
  • the processor may further implement the following steps: invoking a service interface of the user terminal to send a current workload difficulty coefficient to the server, so that the server calculates the target workload difficulty according to the service data and the preset work difficulty coefficient. Coefficient; the service data processing result corresponding to the service data returned by the server through the service interface of the server when the current workload difficulty coefficient is consistent with the target workload difficulty coefficient through the service interface.
  • a computer readable storage medium having stored thereon a computer program, such as the non-volatile storage medium shown in FIG. 6, wherein the memory may include a disk, an optical disk, and a read-only memory.
  • Non-volatile storage medium such as Read-Only Memory (ROM).
  • the memory includes a non-volatile storage medium and an internal memory.
  • a non-volatile storage medium of a computer device stores an operating system, a database, and a computer executable program.
  • the database stores data related to implementing a service interface calling method provided by the above various embodiments.
  • the program is executed by the processor to: obtain the input service data; obtain the input workload proof instruction corresponding to the service data; send a preset workload difficulty coefficient acquisition request to the server; and the receiving server works according to the preset
  • the quantity difficulty coefficient obtains the preset workload difficulty coefficient corresponding to the workload proof instruction returned by the request; calculates the current workload difficulty coefficient according to the service data and the preset workload difficulty coefficient; when the current workload difficulty coefficient is greater than or equal to the preset workload
  • the service interface of the user terminal is called to send the service data to the server.
  • the following steps may be implemented: obtaining a session identifier corresponding to the preset workload difficulty coefficient acquisition request from the server; and setting the service data according to the preset sorting combination manner.
  • the workload difficulty coefficient and the session identifier are sorted and combined to obtain combined data; the message digest is calculated for the combined data to obtain a hash value; and the position of the preset character in the hash value is obtained as the current workload difficulty coefficient.
  • the following steps may be implemented: converting the hash value into a binary character; and obtaining the position of the first non-zero one of the binary characters as the current workload difficulty coefficient.
  • the following steps may be implemented: when the current workload difficulty coefficient is less than the preset workload difficulty coefficient, the session identifier is adjusted according to the preset step size, and according to the service data, The preset workload difficulty coefficient and the adjusted session identifier calculate the current workload difficulty coefficient until the current workload difficulty coefficient is greater than or equal to the preset workload difficulty coefficient.
  • the following steps may be further implemented: invoking a service interface of the user terminal to send a current workload difficulty coefficient to the server, so that the server is configured according to The service data and the preset work difficulty coefficient are used to calculate the target workload difficulty coefficient; the service data processing corresponding to the service data returned by the service interface receiving server through the service interface of the server when the current workload difficulty coefficient is consistent with the target workload difficulty coefficient result.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种业务接口调用方法、装置、用户终端和可读存储介质,该方法包括获取输入的业务数据;获取输入的工作量证明指令;向服务器发送预设工作量难度系数获取请求;接收服务器返回的预设工作量难度系数;根据业务数据和预设工作量难度系数计算当前工作量难度系数;当当前工作量难度系数大于等于预设工作量难度系数时,则调用用户终端的业务接口向服务器发送所述业务数据。

Description

业务接口调用方法、装置、用户终端和可读存储介质
本申请要求于2017年7月25日提交中国专利局、申请号为2017106138377、发明名称为“业务接口调用方法、装置、用户终端和可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机技术领域,特别是涉及一种业务接口调用方法、装置、用户终端和可读存储介质。
背景技术
随着互联网技术的发展,许多业务均采用自动化的处理过程,从而可以提高业务处理的效率,节约时间。但是仍存在一些业务由于需要保护个人信息等原因,需要经过人工操作才可以进行处理,例如登录网上银行的业务等,但是当前存在大量的自动化软件未经过用户授权就通过业务接口来获取银行账单等个人隐私信息,造成业务接口滥用,个人信息泄露。
传统中,为了防止业务接口被自动化软件滥用,通过图灵测试的方式来识别人工操作,只有通过图灵测试的人工操作才可以调用相应的业务接口,请求服务器返回相应的业务结果。但是由于人类操作一般是通过语音反馈、键盘鼠标动作等等来表示,图灵测试对于该些操作识别的正确率低,从而不能准确地区分人类操作和自动化软件的操作,导致仍存在自动化软件滥用业务接口的情况。
发明内容
根据本申请的各种实施例,提供一种业务接口调用方法、装置、用户终端和可读存储介质,解决了背景技术中所涉及的一个或多个问题。
一种业务接口调用方法,包括:
获取输入的业务数据;
获取输入的与所述业务数据对应的工作量证明指令;
向服务器发送预设工作量难度系数获取请求;
接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系数;及
当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调用用户终端的业务接口向所述服务器发送所述业务数据。
一种业务接口调用装置,包括:
获取模块,用于获取输入的业务数据,以及获取输入的与所述业务数据对应的工作量证明指令;
发送模块,用于向服务器发送预设工作量难度系数获取请求;
接收模块,用于接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
计算模块,用于根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系数;及
调用模块,用于当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调用用户终端的业务接口向所述服务器发送所述业务数据。
一种用户终端,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下步骤:
获取输入的业务数据;
获取输入的与所述业务数据对应的工作量证明指令;
向服务器发送预设工作量难度系数获取请求;
接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系 数;
当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调用用户终端的业务接口向所述服务器发送所述业务数据。
一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:
获取输入的业务数据;
获取输入的与所述业务数据对应的工作量证明指令;
向服务器发送预设工作量难度系数获取请求;
接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系数;
当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调用用户终端的业务接口向所述服务器发送所述业务数据。
本发明的一个或多个实施例的细节在下面的附图和描述中提出。本发明的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一实施例中业务接口调用方法的应用场景图;
图2为一实施例中业务接口调用方法的流程图;
图3为一实施例中的业务接口调用方法的时序图;
图4为一实施例中的业务接口调用装置的示意图;
图5为另一实施例中的业务接口调用装置的示意图;
图6为一实施例中的用户终端的结构示意图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用于解释本发明,并不用于限定本发明。
在详细说明根据本发明的实施例前,应该注意到的是,所述的实施例主要在于与业务接口调用方法、装置、用户终端和可读存储介质相关的步骤和系统组件的组合。因此,所属系统组件和方法步骤已经在附图中通过常规符号在适当的位置表示出来了,并且只示出了与理解本发明的实施例有关的细节,以免因对于得益于本发明的本领域普通技术人员而言显而易见的那些细节模糊了本发明的公开内容。
在本文中,诸如左和右,上和下,前和后,第一和第二之类的关系术语仅仅用来区分一个实体或动作与另一个实体或动作,而不一定要求或暗示这种实体或动作之间的任何实际的这种关系或顺序。术语“包括”、“包含”或任何其他变体旨在涵盖非排他性的包含,由此使得包括一系列要素的过程、方法、物品或者设备不仅包含这些要素,而且还包含没有明确列出的其他要素,或者为这种过程、方法、物品或者设备所固有的要素。
参阅图1,图1为一实施例中业务接口调用方法的应用场景图,其中包括业务终端和服务器,业务终端可以与服务器进行通信。用户通过业务终端进行业务处理,然后业务终端将业务处理所得到的业务数据发送给服务器,以从服务器获取与该业务数据对应的处理结果。其中业务终端可以为用户的电脑、手机、平板电脑等设备。
请参阅图2,在其中一个实施例中,提供一种业务接口调用方法,本实施例以该方法应用到上述图1中的业务终端来举例说明。该业务终端上运行有业务接口调用程序,通过该业务接口调用程序来实施业务接口调用方法。该方法具体包括如下步骤:
S202:获取输入的业务数据。
具体地,业务终端可以提供业务表单显示界面,从而用户可以通过业务表单显示界面向业务终端输入相应的业务数据。例如登录页面作为业务表单时,其上显示有用户账号和用户密码的输入框,用户可以通过该输入框输入用户账号和用户密码,此时用户账号和用户密码即为此处的业务数据。此外,当查询页面作为业务表单时,例如浏览器的查询页面,其上显示有搜索框,用户可以通过该搜索框输入所要所搜的内容的关键字,此时该关键字即为此处的业务数据。
S204:获取输入的与业务数据对应的工作量证明指令。
具体地,工作量证明指令即用户向用户终端输入的指令,其是为了向用户终端表示当前使用用户终端的不是自动化软件。其中,可以通过在用户终端的显示界面上设置一按钮,例如“我不是机器人”按钮,或者“I am not a robot”按钮,当用户点击该按钮时,则生成与业务数据对应的工作量证明指令。
S206:向服务器发送预设工作量难度系数获取请求。
具体地,为了计算当前的工作量难度系数,用户终端开启一轻量级的会话,向服务器发送预设工作量难度系数获取请求以获取存储在服务器的预设工作量难度系数。从服务器获取预设工作量难度系数是为了防止用户终端仅根据自身存储的内容计算当前工作量难度系数,如果用户终端仅根据自身存储的内容计算当前工作量难度系数,则用户终端可以随意地更改数据,或者不更改数据,直接向服务器发送上一次的工作量难度系数,由于服务器也是根据用户终端发送的数据来计算当前工作量难度系数,因此服务器无法准确地判断用户终端所计算的当前工作量难度系数是否正确,从而导致用户终端极易被非法使用。
S208:接收服务器根据预设工作量难度系数获取请求返回的与工作量证明指令对应的预设工作量难度系数。
具体地,当服务器接收到预设工作量难度系数获取请求时,则会根据该 请求查询与工作量证明指令对应的预设工作量难度系数,例如服务器中可以存储有一表格,该表格中存储有工作量证明指令与预设工作量难度系数的对应关系,服务器可以根据工作量证明指令查询到对应的预设工作量难度系数。
S210:根据业务数据和预设工作量难度系数计算当前工作量难度系数。
具体地,当用户终端接收到服务器返回的预设工作量难度系数时,则根据用户终端中存储的业务数据和服务器返回的预设工作量难度系数来计算当前工作量难度系数,这样根据两端的数据来计算当前工作量难度系数,可以防止用户终端被自动化等软件使用,例如当自动化软件使用用户终端时,其一般会批量来进行业务处理,从而也会批量计算当前工作量难度系数,因此需要批量从服务器获取对应的预设工作量难度系数,这对于批量处理来说是比较难以实现的,其极易造成处理过程的混乱,从而导致业务处理失败。
S212:当当前工作量难度系数大于等于预设工作量难度系数时,则调用用户终端的业务接口向服务器发送业务数据。
具体地,当当前工作量难度系数大于等于预设工作量难度系数时,即表明用户终端在处理当前业务时,需要耗费一定的工作量,因此其不是自动化软件,从而可以调用相应的业务接口向服务器发送业务数据。如果不使用该工作量证明机制来证明用户终端在处理当前业务时,需要耗费一定的工作量,例如当使用自动化软件来处理当前业务时,则业务接口会被自动化软件一直占用,导致真正需要使用业务接口的业务无法正常处理,造成业务接口的滥用。
上述的业务安全调用方法,只有通过业务数据、预设工作量难度系数计算得到的当前工作量难度系数大于等于从服务器获取的预设工作量难度系数时,才会认为该业务数据是通过人工操作产生的,从而才会调用相应的业务接口,向服务器发送业务数据,但是如果采用自动化软件来处理处理时,由于自动化软件在处理是采用的是批量处理的方式,无法批量向终端输入相应的工作量难度证明指令,从而不能通过业务接口向服务器发送业务数据,防止了业务接口被自动化软件滥用。
在其中一个实施例中,根据业务数据和预设工作量难度系数,计算当前工作量难度系数的步骤可以包括:从服务器获取与预设工作量难度系数获取请求对应的会话标识;根据预设的排序组合方式对业务数据、预设工作量难度系数以及会话标识进行排序组合,得到组合数据;对组合数据进行消息摘要计算得到散列值;获取散列值中预设字符的位置作为当前工作量难度系数。
具体地,会话标识是指用户终端与服务器本次获取预设工作量难度系数会话的会话标识,其一般为一随机数,例如0、1、2、3、4等。预设的排序组合方式是服务器和用户终端约定的排序组合方式,例如业务数据排在预设工作量难度系数之前,预设工作量难度系数排在会话标识之前,或者业务数据排在会话标识之前,会话标识排在预设工作量难度系数之前等,在此不限制该排序的具体方式,只要用户终端和服务器关于该排序的方式是一致的即可。消息摘要计算可以是通过MD5算法计算,或者其他的消息摘要计算方式进行计算。
在其中一个实施例中,获取散列值中预设字符的位置作为当前工作量难度系数的步骤可以包括:将散列值转换为二进制字符;获取二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
具体地,当前工作量难度系数是根据业务数据、预设工作量难度系数以及会话标识所形成的组合数据所计算的散列值求得的,为了方便将该散列值转化为二进制字符,在其他实施例中,还可以转化为十进制字符,十六进制字符等。当转化为二进制字符时,预设字符可以为1或0,例如当预设字符为1时,则可以将转化后的二进制字符从左往右排列,获取该二进制字符中的第一个非零的一,即第一个1所在的位置作为当前工作量难度系数,例如当二进制字符为“0000000101000101”时,则当前工作量难度系数为8,因为第一个1排列在第8位。
在其中一个实施例中,上述的业务接口调用方法还可以包括:当当前工作量难度系数小于预设工作量难度系数时,则按照预设步长调整会话标识,并根据业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作 量难度系数,直至当前工作量难度系数大于等于预设工作量难度系数。
具体地,当第一次所计算的当前工作量难度系数小于预设工作量难度系数时,可以调整会话标识,例如当会话标识为一随机数,且为0时,预设步长可以为1、2、3、6等,当预设步长为1时,则调整会话标识为1,再计算会话标识为1时的当前工作量难度系数,直至当前工作量难度系数大于等于预设工作量难度系数时,再调用用户终端的业务接口向服务器发送相应的业务数据。
在其中一个实施例中,业务接口调用方法还可以包括:调用用户终端的业务接口向服务器发送当前工作量难度系数,以使服务器根据业务数据和预设工作难度系数计算目标工作量难度系数;通过业务接口接收服务器在当前工作量难度系数与目标工作量难度系数相一致时通过服务器的业务接口返回的与业务数据对应的业务数据处理结果。
具体地,用户终端调用用户终端的业务接口向服务器发送当前工作量难度系数和业务数据,服务器首先查询到服务器存储的预设工作量难度系数,再根据已存储的预设工作量难度系数和业务数据按照与用户终端一样的方式计算目标工作量难度系数,只有该目标工作量难度系数与用户终端发送来的当前工作量难度系数相同时,服务器才会调用服务器响应的业务接口向用户终端返回与业务数据对应的处理结果。
请参阅图3所示,图3为一实施例中的业务接口调用方法的时序图,其中该实施例中以用户终端b需要通过用户终端b的业务接口a请求服务器s的一个业务接口i的数据,例如查询当前外汇汇率业务。
首先,用户终端提供用户表单界面,其包含用户名Username、密码Password和外汇符号forexTag,以及一工作量证明指令按钮“我不是机器人”,用户通过用户表单界面输入用户名、密码和外汇符号后,点击工作量证明指令按钮,从而用户终端会向服务器请求一与当前工作量证明指令,即与当前业务数据对应的预设工作量难度系数,服务器在接收到预设工作量难度系数获取请求后,会向用户终端返回一预设工作量难度系数以及本次会话的会话 标识,假设本次预设工作量难度系数为7,会话标识为0。
其次,用户终端根据服务器返回的预设工作量难度系数、本次会话的会话标识和业务数据计算当前工作量难度系数。其中业务数据包含用户名Username、密码Password和外汇符号forexTag。例如,用户终端将预设工作量难度系数、本次会话的会话标识和业务数据进行排列组合,如下所示:
difficulty=7&forextag=usd&nonce=0&password=secret&sid=123123123.123123.123&username=hello
其中,difficulty表示预设当前工作难度系数,forextag表示外汇符号,nonce表示随机数,password表示密码,sid表示安全标识符,是标识用户、组和计算机账户的唯一地号码,username表示用户名。
第三,将排序组合后的组合数据进行消息摘要计算,例如可以通过SHA256消息摘要计算得到散列值,即hash值:5285ea9f915b1238822ec0529f6aa7600adf23a6438858d62d278a515fe89ca9。
第四,将该散列值从左向右排列,然后转换为二进制字符,当第一个非0的1出现在第6个位置,可以定义改当前工作量难度系数为5。如果预设的工作量难度系数为7,那么当前工作量难度系数不满足预设的工作量难度系数。
第五,按照预设步长递增会话标识nonce值,得到新的组合数据:
difficulty=7&forextag=usd&nonce=1&password=secret&sid=123123123.123123.123&username=hello
然后重复上述第三步,再次计算散列值,直至满足预设工作量难度系数,上述当会话标识nonce=95的时候,得到散列值为:
01db19b5af692ea1831dc2a499ac05cf32c3d30106d292f0dd60a181c8d5f364
其最左边有7个0,即当前工作量难度系数为7,等于预设工作量难度系数,于是将组合数据以及散列值提交给服务器:
difficulty=7&forextag=usd&nonce=95&password=secret&sid=123123123.123123.123&username=hello&hash=01db19b5af692ea1831dc2a499ac05cf32c3d3 0106d292f0dd60a181c8d5f364
第六,服务器在接收到用户终端所发送的上述组合数据和散列值时,对上述组合数据和散列值进行解析,得到散列值和组合数据:
hash=01db19b5af692ea1831dc2a499ac05cf32c3d30106d292f0dd60a181c8d5f364以及
difficulty=7&forextag=usd&nonce=95&password=secret&sid=123123123.123123.123&username=hello
然后服务器可以根据组合数据(其中包含预设工作量难度系数以及业务数据)计算一次得到目标散列值:
Hash’=01db19b5af692ea1831dc2a499ac05cf32c3d30106d292f0dd60a181c8d5f364
其与用户终端所提交来的散列值是一致的,说明用户终端是经过大量的计算搜索得到的会话标识,进而得到满足预设工作量难度系数的散列值,从而该请求合法,因此服务器可以调用服务器业务接口与给用户终端返回业务数据相应的处理结果,防止服务器业务接口被滥用。
其中服务器可以根据组合数据计算一次得到目标散列值时,可以先根据组合数据获取到预设工作量难度系数并与本地存储的预设工作量难度系数进行比较,只要两者相同时才会继续下一步,或者直接获取本地存储的工作量难度系数以及组合数据中的业务数据、会话标识来重新形成组合数据,例如按照与用户终端一样的排序组合方式进行排序组合后获取组合数据,再计算得到目标散列值,根据目标散列值得到目标工作量难度系数,当目标工作量难度系数与用户终端所提交的当前工作量难度系数一致时,则说明用户终端是经过大量的计算搜索得到的会话标识,进而得到满足预设工作量难度系数的散列值,从而该请求合法,因此服务器可以调用服务器业务接口与给用户终端返回业务数据相应的处理结果,防止服务器业务接口被滥用。
虽然上文中图2、图3的流程图中的各个步骤按照箭头的指示一次显示,但是这些步骤并不是必然按照箭头指示的顺序一次执行。除非本文中有明确 的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,图2、图3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替执行。
参阅图4,图4为一实施例中的业务接口调用装置的示意图,该业务接口调用装置包括:
获取模块110,用于获取输入的业务数据,以及获取输入的与业务数据对应的工作量证明指令。
发送模块120,用于向服务器发送预设工作量难度系数获取请求。
接收模块130,用于接收服务器根据预设工作量难度系数获取请求返回的与工作量证明指令对应的预设工作量难度系数。
计算模块140,用于根据业务数据和预设工作量难度系数计算当前工作量难度系数。
调用模块150,用于当当前工作量难度系数大于等于预设工作量难度系数时,则调用用户终端的业务接口向服务器发送业务数据。
在其中一个实施例中,参阅图5,图5为另一实施例中的业务接口调用装置的示意图,其中计算模块140可以包括:
会话标识获取单元141,用于从服务器获取与预设工作量难度系数获取请求对应的会话标识。
组合单元142,用于根据预设的排序组合方式对业务数据、预设工作量难度系数以及会话标识进行排序组合得到组合数据。
散列值计算单元143,用于对组合数据进行消息摘要计算得到散列值。
当前工作量难度系数获取单元144,用于获取散列值中预设字符的位置作为当前工作量难度系数。
在其中一个实施例中,当前工作量难度系数获取单元144可以包括:
转换单元1441,用于将散列值转换为二进制字符。
位置获取单元1442,用于获取二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
在其中一个实施例中,调用模块150还可以用于当当前工作量难度系数小于预设工作量难度系数时,则按照预设步长调整会话标识,并根据业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作量难度系数,直至当前工作量难度系数大于等于预设工作量难度系数。
在其中一个实施例中,调用模块150还可以用于调用用户终端的业务接口向服务器发送当前工作量难度系数,以使服务器根据业务数据和预设工作难度系数计算目标工作量难度系数;通过业务接口接收服务器在当前工作量难度系数与目标工作量难度系数相一致时通过服务器的业务接口返回的与业务数据对应的业务数据处理结果。
上述关于业务接口调用装置的限定可以参加上文中关于业务接口调用方法的限定,在此不再赘述。上述网页数据爬取装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。该处理器可以为中央处理单元(CPU)、微处理器、单片机等。上述业务接口调用装置可以实现为一种计算机程序的形式,计算机程序可在如图1所示的用户终端运行。
本发明实施例提出了一种计算机设备,该计算机设备包括一系列存储于存储器上的计算机程序,当计算机程序被处理器执行时,可以实现本发明各个实施例提出的业务接口调用方法,在一些实施例中,基于该计算机程序各部分所实现的特定的操作。请参阅图6,图6为一实施例中的用户终端的结构示意图,其中用户终端包括通过系统总线连接的存储器、处理器、操作系统,其中该处理器用于提供计算和控制能力,支撑整个计算机设备的运行。存储器用于存储数据、程序代码等。
该存储器上存储至少一个计算机可执行程序,该计算机可执行程序可被处理器执行,以实现本申请各实施例中提供的业务接口调用方法。该计算机 可执行程序可被处理器所执行,以用于实现上述各个实施例所提供的一种业务接口调用方法。用户终端中的内存储器为非易失性存储介质中的操作系统、数据库和计算机可执行程序提供高速缓存的运行环境。
其中,处理器执行程序时实现以下步骤:获取输入的业务数据;获取输入的与业务数据对应的工作量证明指令;向服务器发送预设工作量难度系数获取请求;接收服务器根据预设工作量难度系数获取请求返回的与工作量证明指令对应的预设工作量难度系数;根据业务数据和预设工作量难度系数计算当前工作量难度系数;当当前工作量难度系数大于等于预设工作量难度系数时,则调用用户终端的业务接口向服务器发送业务数据。
在其中一个实施例中,处理器执行程序时还可以实现以下步骤:从服务器获取与预设工作量难度系数获取请求对应的会话标识;根据预设的排序组合方式对业务数据、预设工作量难度系数以及会话标识进行排序组合,得到组合数据;对组合数据进行消息摘要计算得到散列值;获取散列值中预设字符的位置作为当前工作量难度系数。
在其中一个实施例中,处理器执行程序时还可以实现以下步骤:将散列值转换为二进制字符;获取二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
在其中一个实施例中,处理器执行程序时还可以实现以下步骤:当当前工作量难度系数小于预设工作量难度系数时,则按照预设步长调整会话标识,并根据业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作量难度系数,直至当前工作量难度系数大于等于预设工作量难度系数。
在其中一个实施例中,处理器执行程序时还可以实现以下步骤:调用用户终端的业务接口向服务器发送当前工作量难度系数,以使服务器根据业务数据和预设工作难度系数计算目标工作量难度系数;通过业务接口接收服务器在当前工作量难度系数与目标工作量难度系数相一致时通过服务器的业务接口返回的与业务数据对应的业务数据处理结果。
上述对于用户终端的限定可以参见上文中对于业务接口调用方法的具体 限定,在此不再赘述。
请继续参阅图6,还提供一种计算机可读存储介质,其上存储有计算机程序,如图6中所示的非易失性存储介质,其中,存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质。在一个实施例中,存储器包括非易失性存储介质及内存储器。计算机设备的非易失性存储介质存储有操作系统、数据库和计算机可执行程序。该数据库中存储有用于实现上述各个实施例所提供的一种业务接口调用方法相关的数据。其中,该程序被处理器执行时实现以下步骤:获取输入的业务数据;获取输入的与业务数据对应的工作量证明指令;向服务器发送预设工作量难度系数获取请求;接收服务器根据预设工作量难度系数获取请求返回的与工作量证明指令对应的预设工作量难度系数;根据业务数据和预设工作量难度系数计算当前工作量难度系数;当当前工作量难度系数大于等于预设工作量难度系数时,则调用用户终端的业务接口向服务器发送业务数据。
在其中一个实施例中,该程序被处理器执行时还可以实现以下步骤:从服务器获取与预设工作量难度系数获取请求对应的会话标识;根据预设的排序组合方式对业务数据、预设工作量难度系数以及会话标识进行排序组合,得到组合数据;对组合数据进行消息摘要计算得到散列值;获取散列值中预设字符的位置作为当前工作量难度系数。
在其中一个实施例中,该程序被处理器执行时还可以实现以下步骤:将散列值转换为二进制字符;获取二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
在其中一个实施例中,该程序被处理器执行时还可以实现以下步骤:当当前工作量难度系数小于预设工作量难度系数时,则按照预设步长调整会话标识,并根据业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作量难度系数,直至当前工作量难度系数大于等于预设工作量难度系数。
在其中一个实施例中,该程序被处理器执行时还可以实现以下步骤:调用用户终端的业务接口向服务器发送当前工作量难度系数,以使服务器根据 业务数据和预设工作难度系数计算目标工作量难度系数;通过业务接口接收服务器在当前工作量难度系数与目标工作量难度系数相一致时通过服务器的业务接口返回的与业务数据对应的业务数据处理结果。
上述对于计算机可读存储介质的限定可以参见上文中对于业务接口调用方法的具体限定,在此不再赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的调用范围。因此,本发明专利的调用范围应以所附权利要求为准。

Claims (20)

  1. 一种业务接口调用方法,其特征在于,包括:
    获取输入的业务数据;
    获取输入的与所述业务数据对应的工作量证明指令;
    向服务器发送预设工作量难度系数获取请求;
    接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
    根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系数;及
    当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调用用户终端的业务接口向所述服务器发送所述业务数据。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述业务数据和所述预设工作量难度系数,计算当前工作量难度系数的步骤,包括:
    从服务器获取与所述预设工作量难度系数获取请求对应的会话标识;
    根据预设的排序组合方式对所述业务数据、预设工作量难度系数以及会话标识进行排序组合,得到组合数据;
    对所述组合数据进行消息摘要计算得到散列值;
    获取所述散列值中预设字符的位置作为当前工作量难度系数。
  3. 根据权利要求2所述的方法,其特征在于,所述获取所述散列值中预设字符的位置作为当前工作量难度系数的步骤,包括:
    将所述散列值转换为二进制字符;
    获取所述二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
  4. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    当所述当前工作量难度系数小于所述预设工作量难度系数时,则按照预设步长调整所述会话标识,并根据所述业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作量难度系数,直至所述当前工作量难度系数 大于等于所述预设工作量难度系数。
  5. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    调用用户终端的业务接口向所述服务器发送所述当前工作量难度系数,以使所述服务器根据所述业务数据和预设工作难度系数计算目标工作量难度系数;
    通过所述业务接口接收所述服务器在所述当前工作量难度系数与目标工作量难度系数相一致时通过服务器业务接口返回的与所述业务数据对应的业务数据处理结果。
  6. 一种业务接口调用装置,其特征在于,包括:
    获取模块,用于获取输入的业务数据,以及获取输入的与所述业务数据对应的工作量证明指令;
    发送模块,用于向服务器发送预设工作量难度系数获取请求;
    接收模块,用于接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
    计算模块,用于根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系数;及
    调用模块,用于当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调用用户终端的业务接口向所述服务器发送所述业务数据。
  7. 根据权利要求6所述的装置,其特征在于,所述计算模块包括:
    会话标识获取单元,用于从服务器获取与所述预设工作量难度系数获取请求对应的会话标识;
    组合单元,用于根据预设的排序组合方式对所述业务数据、预设工作量难度系数以及会话标识进行排序组合得到组合数据;
    散列值计算单元,用于对所述组合数据进行消息摘要计算得到散列值;
    当前工作量难度系数获取单元,用于获取所述散列值中预设字符的位置作为当前工作量难度系数。
  8. 根据权利要求7所述的装置,其特征在于,所述当前工作量难度系数获取单元包括:
    转换单元,用于将所述散列值转换为二进制字符;
    位置获取单元,用于获取所述二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
  9. 根据权利要求7所述的装置,其特征在于,所述调用模块还用于当所述当前工作量难度系数小于所述预设工作量难度系数时,则按照预设步长调整所述会话标识,并根据所述业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作量难度系数,直至所述当前工作量难度系数大于等于所述预设工作量难度系数。
  10. 根据权利要求7所述的装置,其特征在于,所述调用模块还用于调用用户终端的业务接口向所述服务器发送所述当前工作量难度系数,以使所述服务器根据所述业务数据和预设工作难度系数计算目标工作量难度系数;通过所述业务接口接收所述服务器在所述当前工作量难度系数与目标工作量难度系数相一致时通过服务器业务接口返回的与所述业务数据对应的业务数据处理结果。
  11. 一种用户终端,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现以下步骤:
    获取输入的业务数据;
    获取输入的与所述业务数据对应的工作量证明指令;
    向服务器发送预设工作量难度系数获取请求;
    接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
    根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系数;
    当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调 用用户终端的业务接口向所述服务器发送所述业务数据。
  12. 根据权利要求11所述的用户终端,其特征在于,所述处理器执行的根据所述业务数据和所述预设工作量难度系数,计算当前工作量难度系数的步骤,包括:
    从服务器获取与所述预设工作量难度系数获取请求对应的会话标识;
    根据预设的排序组合方式对所述业务数据、预设工作量难度系数以及会话标识进行排序组合,得到组合数据;
    对所述组合数据进行消息摘要计算得到散列值;
    获取所述散列值中预设字符的位置作为当前工作量难度系数。
  13. 根据权利要求12所述的用户终端,其特征在于,所述处理器执行的获取所述散列值中预设字符的位置作为当前工作量难度系数的步骤,包括:
    将所述散列值转换为二进制字符;
    获取所述二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
  14. 根据权利要求12所述的用户终端,其特征在于,所述处理器执行所述程序时还实现以下步骤:
    当所述当前工作量难度系数小于所述预设工作量难度系数时,则按照预设步长调整所述会话标识,并根据所述业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作量难度系数,直至所述当前工作量难度系数大于等于所述预设工作量难度系数。
  15. 根据权利要求12所述的用户终端,其特征在于,所述处理器执行所述程序时还实现以下步骤:
    调用用户终端的业务接口向所述服务器发送所述当前工作量难度系数,以使所述服务器根据所述业务数据和预设工作难度系数计算目标工作量难度系数;
    通过所述业务接口接收所述服务器在所述当前工作量难度系数与目标工作量难度系数相一致时通过服务器业务接口返回的与所述业务数据对应的业 务数据处理结果。
  16. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现以下步骤:
    获取输入的业务数据;
    获取输入的与所述业务数据对应的工作量证明指令;
    向服务器发送预设工作量难度系数获取请求;
    接收所述服务器根据所述预设工作量难度系数获取请求返回的与所述工作量证明指令对应的预设工作量难度系数;
    根据所述业务数据和所述预设工作量难度系数计算当前工作量难度系数;
    当所述当前工作量难度系数大于等于所述预设工作量难度系数时,则调用用户终端的业务接口向所述服务器发送所述业务数据。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时实现的根据所述业务数据和所述预设工作量难度系数,计算当前工作量难度系数的步骤,包括:
    从服务器获取与所述预设工作量难度系数获取请求对应的会话标识;
    根据预设的排序组合方式对所述业务数据、预设工作量难度系数以及会话标识进行排序组合,得到组合数据;
    对所述组合数据进行消息摘要计算得到散列值;
    获取所述散列值中预设字符的位置作为当前工作量难度系数。
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时实现的获取所述散列值中预设字符的位置作为当前工作量难度系数的步骤,包括:
    将所述散列值转换为二进制字符;
    获取所述二进制字符中第一个非零的一所在的位置作为当前工作量难度系数。
  19. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述程 序被处理器执行时还实现以下步骤:
    当所述当前工作量难度系数小于所述预设工作量难度系数时,则按照预设步长调整所述会话标识,并根据所述业务数据、预设工作量难度系数以及调整后的会话标识计算当前工作量难度系数,直至所述当前工作量难度系数大于等于所述预设工作量难度系数。
  20. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述程序被处理器执行时还实现以下步骤:
    调用用户终端的业务接口向所述服务器发送所述当前工作量难度系数,以使所述服务器根据所述业务数据和预设工作难度系数计算目标工作量难度系数;
    通过所述业务接口接收所述服务器在所述当前工作量难度系数与目标工作量难度系数相一致时通过服务器业务接口返回的与所述业务数据对应的业务数据处理结果。
PCT/CN2017/104838 2017-07-25 2017-09-30 业务接口调用方法、装置、用户终端和可读存储介质 WO2019019393A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710613837.7A CN107688733B (zh) 2017-07-25 2017-07-25 业务接口调用方法、装置、用户终端和可读存储介质
CN201710613837.7 2017-07-25

Publications (1)

Publication Number Publication Date
WO2019019393A1 true WO2019019393A1 (zh) 2019-01-31

Family

ID=61152983

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/104838 WO2019019393A1 (zh) 2017-07-25 2017-09-30 业务接口调用方法、装置、用户终端和可读存储介质

Country Status (2)

Country Link
CN (1) CN107688733B (zh)
WO (1) WO2019019393A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905395B (zh) * 2019-03-07 2021-09-07 武汉斗鱼鱼乐网络科技有限公司 一种验证客户端可信的方法及相关装置
CN111314332A (zh) * 2020-02-05 2020-06-19 中国工商银行股份有限公司 访问控制方法、装置、计算机系统和计算机可读存储介质
CN111510427B (zh) * 2020-03-06 2022-02-11 杜晓楠 在i2p网络系统中缓解路径创建攻击的方法、计算机可读存储介质和i2p网络系统
CN111541732B (zh) * 2020-03-06 2022-12-09 杜晓楠 在p2p网络中避免客户端无效占用连接资源的方法、计算机可读存储介质和p2p网络
WO2021175036A1 (zh) * 2020-03-06 2021-09-10 杜晓楠 在p2p网络中避免客户端节点长时间无效占用连接资源和引导客户端节点合理选择节点带宽
CN111555900B (zh) * 2020-03-06 2022-09-20 杜晓楠 引导p2p网络中客户端节点合理选择节点带宽的方法、计算机可读存储介质和p2p网络

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743893A (zh) * 2016-01-29 2016-07-06 大连秘阵科技有限公司 一次性动态定位认证方法、系统和密码变更方法
US20160218879A1 (en) * 2015-01-23 2016-07-28 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
CN106571925A (zh) * 2016-10-24 2017-04-19 北京云图科瑞科技有限公司 对区块链系统中的区块进行工作量证明的方法及装置
CN106651346A (zh) * 2016-11-28 2017-05-10 上海凯岸信息科技有限公司 基于区块链的征信数据共享与交易系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104184709A (zh) * 2013-05-23 2014-12-03 腾讯科技(深圳)有限公司 验证方法、装置、服务器、业务数据中心和系统
CN104539434A (zh) * 2015-01-23 2015-04-22 济南同智伟业软件股份有限公司 基于时间戳和gps定位的电子签章系统及方法
CN105046141B (zh) * 2015-06-12 2019-05-03 北京京东尚科信息技术有限公司 一种自适应的验证码设计方法及系统
CN106470229B (zh) * 2015-08-19 2019-10-01 阿里巴巴集团控股有限公司 一种业务相关信息处理方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160218879A1 (en) * 2015-01-23 2016-07-28 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
CN105743893A (zh) * 2016-01-29 2016-07-06 大连秘阵科技有限公司 一次性动态定位认证方法、系统和密码变更方法
CN106571925A (zh) * 2016-10-24 2017-04-19 北京云图科瑞科技有限公司 对区块链系统中的区块进行工作量证明的方法及装置
CN106651346A (zh) * 2016-11-28 2017-05-10 上海凯岸信息科技有限公司 基于区块链的征信数据共享与交易系统

Also Published As

Publication number Publication date
CN107688733A (zh) 2018-02-13
CN107688733B (zh) 2020-03-06

Similar Documents

Publication Publication Date Title
US11303603B2 (en) System and method for identity resolution across disparate distributed immutable ledger networks
WO2019019393A1 (zh) 业务接口调用方法、装置、用户终端和可读存储介质
WO2021003979A1 (zh) 数据录入方法、系统、设备及存储介质
US11620444B2 (en) Providing action associated with event detected within communication
US20190057297A1 (en) Leveraging knowledge base of groups in mining organizational data
WO2016101811A1 (zh) 一种信息排序方法及装置
EP3513316B1 (en) Personalized search environment
US20180052696A1 (en) Providing teaching user interface activated by user action
WO2019179244A1 (zh) 一种业务校验方法和装置
CN111752964A (zh) 基于数据接口的数据处理方法及装置
US11677562B2 (en) HASSH profiling mechanism
US11528146B1 (en) Fork table of an authenticated index data structure
US20090328034A1 (en) Establishing a bi-directional grid computing network
WO2022110716A1 (zh) 冷启动推荐方法、装置、计算机设备及存储介质
EP3455805A1 (en) Enhancing contact card based on knowledge graph
US20180046656A1 (en) Constructing filterable hierarchy based on multidimensional key
US11157508B2 (en) Estimating the number of distinct entities from a set of records of a database system
US20180367492A1 (en) Providing notification based on dynamic group
CN114996557B (zh) 服务稳定性确定方法、装置、设备以及存储介质
CN114697378B (zh) 一种网站访问方法、装置、设备及介质
US20230028702A1 (en) Private information with a shared single source of truth
CN103034651B (zh) 微博信息分发方法和分发服务器
WO2018165959A1 (zh) 电商数据清理系统及方法

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: 17918818

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17918818

Country of ref document: EP

Kind code of ref document: A1