Data access method and device, electronic equipment and computer readable storage medium

By receiving data access requests and creating target channels to obtain data, the problems of waste of resources and excessive load in the middle and backend system caused by duplicate requests are solved, and resource conservation and system stability are improved.

CN119276946APending Publication Date: 2025-01-07DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411243644.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In the prior art, repeated requests lead to repeated access and calculation of middle and backend systems, resulting in problems such as wasting system resources, excessive load, request queueing and waiting time.

Method used

By receiving data access requests, determining duplicate requests based on parameter information, and creating a target channel to obtain target data, returning data after closing the channel, avoiding duplicate access and calculation, and optimizing system resource utilization.

Benefits of technology

Save system resources, shorten request queueing and waiting time, and improve data consistency, security and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276946A_ABST
    Figure CN119276946A_ABST
Patent Text Reader

Abstract

The invention provides a data access method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of data processing. The data access method comprises the following steps: receiving a data access request; determining duplicate requests in the data access requests based on the parameter information of the data access requests, and creating a target channel based on a first duplicate request in the duplicate requests; obtaining target data corresponding to the first repeated request based on the target channel, and closing the target channel; and returning the target data. For the repeated requests, the target data is obtained and returned through the target channel created by the first repeated request in the repeated requests, repeated access and calculation of the same requests are avoided, and waste of system resources is reduced. Besides, after the first repeated request information obtains the target data and closes the channel, the target data is returned, so that the consistency of the data and the stability of the system are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data access method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the continuous development of computer and communication technology, the amount of data has also exploded. Data processing, as a basic link in system engineering and automatic control, runs through all areas of social production and social life, and has greatly affected the development of human society. Among them, data access is an important link in data processing, and it is of great significance to study it.

[0003] In related technologies, data access technology enables upstream businesses to obtain required data by accessing downstream systems. For example, in the financial industry, an upper-level business requesting a business management page can be implemented by sending a data access request to the middle and back-end data, and calling the middle and back-end system interface corresponding to the business management page based on the data access request to achieve the purpose of accessing the data required by the business management page.

[0004] However, in the above process, the upper-level business may have repeated requests to the middle and back-end systems. For example, the same business management page may include repeated requests for the same interface. The repeated requests will lead to repeated access and calculations to the middle and back-end systems, which will lead to problems such as waste of system resources. In addition, a large number of repeated requests may cause the middle and back-end systems to be overloaded, thereby increasing the queuing and waiting time of the middle and back-end requests, resulting in blocking and increased time consumption of the requests. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a data access method, device, electronic device and computer-readable storage medium to solve the problems of repeated access and calculation of mid- and back-end systems due to repeated requests, which in turn leads to waste of system resources, excessive load on the mid- and back-end systems, increased queuing and waiting time for mid- and back-end requests, and increased blocking and time consumption of requests.

[0006] According to a first aspect of the present disclosure, a data access method is provided, comprising: receiving a data access request; determining a repeated request in the data access request based on parameter information of the data access request, and creating a target channel based on a first repeated request in the repeated requests; wherein the first repeated request is any one of the data access requests in the repeated requests; obtaining target data corresponding to the first repeated request based on the target channel, closing the target channel; and returning the target data.

[0007] According to a second aspect of the present disclosure, a data access device is provided, comprising: a request receiving module, used to receive a data access request; a channel creation module, used to determine a repeated request in the data access request based on parameter information of the data access request, and create a target channel based on the first repeated request in the repeated request; wherein the first repeated request is any one of the data access requests in the repeated requests; a data acquisition module, used to acquire target data corresponding to the first repeated request based on the target channel, and close the target channel; and a data access module, used to return the target data.

[0008] According to a third aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory storing a program, wherein the program comprises instructions, which, when executed by the processor, cause the processor to perform the above-mentioned data access method.

[0009] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned data access method.

[0010] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:

[0011] In the data access method provided in the exemplary implementation of the present disclosure, a data access request is received; a repeated request in the data access request is determined based on the parameter information of the data access request, and a target channel is created based on the first repeated request in the repeated request; the target data corresponding to the first repeated request is obtained based on the target channel, and the target channel is closed; and the target data is returned. In the data access method provided in the embodiment of the present disclosure, a repeated request is determined based on the parameter information of the data access request, a target channel is created through any data access request in the repeated request, and the target data is obtained through the target channel. On the one hand, the target data is obtained through a data access request in the repeated request, which avoids repeated access and calculation of the middle and back-end systems, thereby achieving the effect of saving system resources; on the other hand, only one request is made through the first repeated request, which can also solve the problem of excessive load on the middle and back-end systems caused by a large number of repeated requests, shorten the queuing and waiting time of the middle and back-end requests, reduce the blocking of requests, and reduce time consumption; in addition, by obtaining data from the target system created for the first repeated request, and returning the obtained target data after closing the target channel, the consistency, security and reusability of the data are ensured, and the stability of the system is improved.

[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0014] Figure 1 A flow chart of a data access method according to an exemplary embodiment of the present disclosure is shown;

[0015] Figure 2 A flow chart showing another data access method according to an exemplary embodiment of the present disclosure is shown;

[0016] Figure 3 A method flow chart of creating a target channel in another data access method according to an exemplary embodiment of the present disclosure is shown;

[0017] Figure 4 A method flow chart of returning target data in another data access method according to an exemplary embodiment of the present disclosure is shown;

[0018] Figure 5 A method flow chart of returning target data in another data access method according to an exemplary embodiment of the present disclosure is shown;

[0019] Figure 6 A flowchart of another data access method according to an exemplary embodiment of the present disclosure is shown;

[0020] Figure 7 A schematic block diagram of a data access device according to an exemplary embodiment of the present disclosure is shown;

[0021] Figure 8 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0024] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0025] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0027] The following describes the aspects of the present disclosure with reference to the accompanying drawings for explanation.

[0028] The present disclosure first provides a data access method. Figure 1 As shown, the data access method specifically includes the following steps:

[0029] S110: receiving a data access request;

[0030] S120: determining repeated requests in the data access request based on parameter information of the data access request, and creating a target channel based on a first repeated request in the repeated requests; wherein the first repeated request is any data access request in the repeated requests;

[0031] S130: Acquire target data corresponding to the first repeated request based on the target channel, and close the target channel;

[0032] S140: Return target data.

[0033] In the data access method provided in the embodiment of the present disclosure, a repeated request is determined based on the parameter information of the data access request, a target channel is created through any data access request in the repeated request, and the target data is obtained through the target channel. On the one hand, the target data is obtained through a data access request in the repeated request, which avoids repeated access and calculation to the middle and back-end systems, thereby saving system resources; on the other hand, only one request is made through the first repeated request, which can also solve the problem of excessive load on the middle and back-end systems caused by a large number of repeated requests, shorten the queuing and waiting time of the middle and back-end requests, reduce the blocking of requests, and reduce time consumption; in addition, by obtaining data from the target system created for the first repeated request and closing the target channel, the obtained target data is returned, which ensures the consistency, security and reusability of the data and improves the stability of the system.

[0034] Next, in another embodiment, the above steps are described in more detail.

[0035] In step S110 , a data access request is received.

[0036] In an embodiment of the present application, the above data access request is used to request access to data in a downstream system.

[0037] In the embodiment of the present application, the above data access request may be a data access request sent by the upper layer service to the middle and back-end system. Exemplarily, the upper layer service may access the required data by calling the corresponding interface of the middle and back-end.

[0038] In an embodiment of the present application, taking the financial industry as an example, the above-mentioned upper-layer business may be a lending business. The data requester may request a lending limit page through an upper-layer lending application. Access to the lending limit page may be achieved by calling multiple middle and back-end interfaces.

[0039] In the embodiment of the present application, the data requester can interact with the mid-backend system by establishing a session with the mid-backend system. All request operations of the same data requester should belong to the same session, that is, the data access requests sent by the same data requester should belong to the same session.

[0040] In the embodiment of the present application, since the data requester may request the same data from the middle and back-end system multiple times at different times in the same session, the embodiment of the present application can search the session cache for the data requested by the data access request after receiving the data access request. If the data requested by the data access request is cached in the session cache, the cache result is directly returned. Through the above process, repeated calculation and access to the middle and back-end underlying service resources are avoided, the resource utilization of the middle and back-end system is improved, the load of the middle and back-end system is reduced, and the performance and stability of the system are improved.

[0041] In an embodiment of the present application, there may be multiple repeated requests in the above-mentioned data access request. For example, taking the above-mentioned financial industry as an example, when accessing the above-mentioned loan limit page, there may be multiple repeated requests for the same middle and back-end interface, which will lead to repeated access and calculation of the middle and back-end systems, resulting in waste of resources of the middle and back-end systems; in addition, a large number of repeated entry requests may cause the middle and back-end system load to be too high, thereby increasing the queuing and waiting time of the middle and back-end requests, resulting in blocking and increased time consumption of requests; furthermore, due to the existence of repeated entry requests, the system accepts repeated requests, which will increase the consumption of computing resources, storage resources, network bandwidth, etc., resulting in low resource utilization.

[0042] Therefore, in order to solve the above problem, the data access method provided in the embodiment of the present application can implement the above repeated requested data access through the following steps S120 to S140 after receiving the data access request:

[0043] In step S120, repeated requests in the data access request are determined based on parameter information of the data access request, and a target channel is created based on a first repeated request in the repeated requests; wherein the first repeated request is any data access request in the repeated requests.

[0044] In the embodiment of the present application, the above-mentioned repeated request refers to a repeated request for the same data at the same time, and the repeated request can be determined by parameter information of the data access request.

[0045] In the embodiment of the present application, the parameter information includes information about the data requested by the data access request and a corresponding session identifier.

[0046] In an embodiment of the present application, the process of determining a repeated request in a data access request based on parameter information of the data access request can be implemented as follows: obtaining parameter information of the data access request; when it is determined that the parameter information is the same, determining that the data access request with the same parameter information is a repeated request. Exemplarily, when the parameter information can include the above-mentioned session identifier and data information of the requested data, when the parameter information is the same, it can be determined that the corresponding data access request is a repeated request.

[0047] In an embodiment of the present application, after determining the duplicate requests in the above data access request, the duplicate requests can be merged based on a single-plane mechanism to reduce repeated access to the underlying service, thereby improving the performance and stability of the system. The above single-plane mechanism means that when multiple request parameters are the same, only one downstream request will be made.

[0048] In the embodiment of the present application, illustratively, before creating the target channel based on the first repeated request in the repeated request, as Figure 2 As shown, the above method may further include the following steps S210 to S220, and when it is determined through S220 that there is cache data corresponding to the data access request in the current session, continue to execute step S230 and step S140, and when it is determined through S220 that there is no cache data corresponding to the data access request in the current session, continue to execute step S240, step S130 and step S140:

[0049] S210: Setting a mutex lock of a global variable corresponding to the target data.

[0050] In the embodiment of the present application, the target data is the data requested by the data access request.

[0051] In an embodiment of the present application, the above-mentioned global variable is used to store data information of the above-mentioned target data.

[0052] In an embodiment of the present application, the above-mentioned mutex lock is used to ensure that only one data access request in the current session operates on the global variable. By setting the mutex lock, it can be ensured that the operation of the cache in a concurrent environment is thread-safe, thereby ensuring the consistency of data and the security of the system.

[0053] S220: Determine whether there is cache data corresponding to the data access request in the current session.

[0054] In the embodiment of the present application, this step can be used to determine whether the data requested by the current data access request is cached in the current session cache.

[0055] In an embodiment of the present application, when it is determined that the data requested by the current data access request exists in the current session cache, by continuing to execute steps S230 and S140, the requested data is directly obtained from the session cache and returned to the data requester corresponding to the current data access request, thereby avoiding repeated calculation and access to the mid- and back-end underlying service resources, thereby improving the resource utilization of the mid- and back-end systems.

[0056] In an embodiment of the present application, when it is determined that the data requested by the current data access request does not exist in the current session cache, by continuing to execute steps S240, S130 and S140, the data requested by the current data access request is obtained based on a repeated request in the repeated requests, and the requested data is returned to the current data access request, thereby reducing the load on the mid- and back-end systems and improving the performance and stability of the system.

[0057] S230: Unlock the mutex lock.

[0058] S240: Create a target channel based on the first repeated request in the repeated requests.

[0059] In the embodiment of the present application, the first repeated request is any data access request in the repeated requests with the same parameter information. The embodiment of the present application only accesses the target data in the downstream system through the first repeated request, thereby realizing the combined processing of the repeated requests and improving the system processing efficiency and resource utilization.

[0060] In an embodiment of the present application, the target channel refers to a channel created for the first repeated request, and the target channel is created by using a mechanism for realizing communication between multiple coroutines based on a channel, and is used to store data obtained based on the first repeated request. Among them, the mechanism for realizing communication between multiple coroutines based on a channel refers to information communication between coroutines executed concurrently in different business scenarios by creating and closing channels.

[0061] In the embodiment of the present application, illustratively, the above step S240 creates a target channel based on the first repeated request in the repeated request, such as Figure 3 As shown, it can be implemented by the following steps S310 to S330:

[0062] S310: Obtain any data access request in the repeated requests, and use any data access request as the first repeated request;

[0063] S320: Establish a target channel for the first repeated request, and store the target channel in a global variable;

[0064] S330: Unlock the mutex lock.

[0065] In step S130, target data corresponding to the first repeated request is acquired based on the target channel, and the target channel is closed.

[0066] In an embodiment of the present application, after creating a target channel for the above-mentioned first repeated request, exemplarily, the above-mentioned acquisition of target data corresponding to the first repeated request based on the target channel can be implemented by the following method: requesting target data from the downstream system and storing the target data in the target channel.

[0067] In the embodiment of the present application, after all the target data corresponding to the first repeated request is obtained, the obtained target data is stored in the target channel, and after the target data storage is completed, the target channel is closed. The above process ensures that only the first repeated request accesses the target data at the same time through the creation and closing of the channel, thereby ensuring the consistency of the data and the stability of the system.

[0068] In step S140, the target data is returned.

[0069] In the embodiment of the present application, Figure 2 Taking the data access method shown in FIG. 1 as an example, when it is determined in S220 that there is cache data corresponding to the data access request in the current session, after the mutex is unlocked in step S130, specifically, the following can be done: Figure 4 Steps S410 to S430 shown implement the above step S140 to return the target data:

[0070] S410: Determine whether the target data is cached;

[0071] S420: If the target data has not been cached, continue to cache the target data;

[0072] S430: If the target data is cached, the target data is returned to the corresponding data requester.

[0073] In the embodiment of the present application, Figure 2 Taking the data access method shown in FIG. 1 as an example, when it is determined through S220 that there is no cache data corresponding to the data access request in the current session, after obtaining the target data corresponding to the first repeated request based on the target channel through step S240 and step S130 and closing the target channel, specifically, the following can be done: Figure 5 The steps S510 to S520 shown implement the above step S140 to return the target data:

[0074] S510: Broadcast the first message.

[0075] In the embodiment of the present application, the first message is used to indicate that the target data corresponding to the first repeated request has been completely cached in the target channel.

[0076] In the embodiment of the present application, the first message is broadcasted to the data requesters corresponding to all the repeated requests, so as to inform the data requesters corresponding to all the repeated requests that "the target data has been cached".

[0077] In the embodiment of the present application, since the above-mentioned first message is broadcast to the data requester corresponding to the repeated request only after the above-mentioned target channel is closed, for the above-mentioned target channel, the write event corresponding to the first repeated request precedes the read events corresponding to other subsequent repeated requests. Therefore, there is no data race between the above-mentioned repeated requests, thereby ensuring data consistency and system stability.

[0078] S520: In response to a request from the data requester corresponding to the repeated request to access the target data, the target data is returned to the data requester corresponding to the repeated request.

[0079] In an embodiment of the present application, after receiving the first message, the data requester corresponding to the repeated request can request the target data from the mid-backend system. After receiving the request to access the target data, the mid-backend system responds to the request to access the target data and returns the target data to the data requester corresponding to the repeated request. Through the above process, the embodiment of the present application no longer returns the target data for some repeated requests to access the target data during the waiting process due to changes in business needs, etc., thereby reducing the system load and improving the utilization of system resources.

[0080] In addition, in an embodiment of the present application, after obtaining the target data corresponding to the first repeated request based on the target channel through step S240 and step S130, and closing the target channel, in the above-mentioned process of returning data, the above-mentioned return of target data can also be achieved by the following method: determining the target repeated request from the repeated requests; returning the target data to the data requester corresponding to the target repeated request. Through the above process, in the above-mentioned process of determining the target repeated request, the embodiment of the present application can return the target data to the interface corresponding to the specified repeated request, or to the interface corresponding to the repeated request that meets the preset conditions. By specifying an interface or setting preset conditions, it is possible to avoid multiple responses to the same interface to send the same data access request multiple times in a short period of time and abnormal requests such as malicious requests, thereby reducing the system load and improving data security and system stability.

[0081] In the data access method provided in the embodiment of the present disclosure, a repeated request is determined based on the parameter information of the data access request, a target channel is created through any data access request in the repeated request, and the target data is obtained through the target channel. On the one hand, the target data is obtained through a data access request in the repeated request, which avoids repeated access and calculation to the middle and back-end systems, thereby saving system resources; on the other hand, only one request is made through the first repeated request, which can also solve the problem of excessive load on the middle and back-end systems caused by a large number of repeated requests, shorten the queuing and waiting time of the middle and back-end requests, reduce the blocking of requests, and reduce time consumption; in addition, by obtaining data from the target system created for the first repeated request and closing the target channel, the obtained target data is returned, which ensures the consistency, security and reusability of the data and improves the stability of the system.

[0082] In a specific embodiment, taking a financial scenario as an example, Figure 6 The above data access methods are elaborated in detail:

[0083] In this specific implementation, Figure 6As shown, the request interface of the middle and back-end systems of the above-mentioned financial scenarios includes a standardized interface, a historical record interface, credit standardization, credit usage standardization and repayment standardization. The upper-level financial business can obtain the corresponding data or services of the downstream system through the above-mentioned request interface. Exemplarily, the above-mentioned standardized interface formulates a set of interface specifications so that different systems or components can interact and communicate effectively, thereby achieving interoperability and integration. The above-mentioned upper-level services can obtain the services of the downstream system through the standardized interface; the above-mentioned historical record interface can be used to obtain historical business data of the downstream system; the above-mentioned credit standardization can be used to obtain services or data about credit from the downstream system; the above-mentioned credit usage standardization can be used to obtain services or data about credit usage from the downstream system; the above-mentioned repayment standardization can be used to obtain services or data about repayment from the downstream system.

[0084] In this specific embodiment, the data requester can send a data access request to the middle and back-end system. For example, the data requester can request the credit limit home page from the middle and back-end system. The request for the credit limit home page can be implemented through multiple data access requests to the request interface. After receiving the data access request, the middle and back-end system can Figure 6 The objective function 1 or the objective function 2 in the above program calls the single-plane mechanism, and obtains the target data corresponding to the data access request based on the single-plane mechanism, thereby realizing the access to the above credit limit homepage.

[0085] Specifically, the process of obtaining the target data corresponding to the data access request based on the single-aircraft mechanism is as follows: Figure 6 As shown, this can be achieved by following the steps below:

[0086] S610: calling a single-aircraft mechanism through an objective function.

[0087] S620: Obtain input parameter information of the data access request.

[0088] In this specific embodiment, the input parameter information includes the information of the data requested by the data access request (uniqueid) and the corresponding session identifier (logid).

[0089] S630: Acquire the mutex lock of the global variable.

[0090] In this specific embodiment, step S630 is used to obtain the mutex lock of the global variable (cache map).

[0091] S640: Determine whether there is cached data in the current session.

[0092] In this specific embodiment, step S640 can be specifically implemented as follows: a pointer to an existing request entry is searched from the index (map) of the above global variable. If the pointer to the existing entry is found, it is determined that there is cache data in the current session, and steps S650, S651, S652 and S670 are continued; if the pointer to the existing entry is not found, it is determined that there is no cache data in the current session, and steps S660, S661, S662, S663 and S670 are continued.

[0093] S650: Perform an unlocking operation on the mutex lock.

[0094] S651: Determine whether the target data has been cached.

[0095] In this specific embodiment, if the target data is cached, step S670 is executed; if the target data is not cached, step S652 is executed.

[0096] S652: Waiting for target data caching to be completed.

[0097] In this specific embodiment, step S652 can be specifically implemented as follows: In this step, the target data has not been cached yet, and another coroutine (goruntine) may still be calling the function call() of the downstream request, so the main goruntine corresponding to the current data access request needs to wait for the entry (data returned by the channel) to be ready before reading the result data of the entry. The specific implementation method is to read data from the ready channel (that is, the above-mentioned target channel). That is, before the ready channel is closed, the main goruntine corresponding to the current data access request has been in a blocked state to read data from the ready channel.

[0098] S660: Determine a repeated request in the data access request, create a target channel for the first repeated request, and store the target channel in a global variable.

[0099] In this specific implementation, step S660 can be specifically implemented as follows: allocate a new entry to the map and create a channel. In the entry, there is a variable ready which is of channel type.

[0100] S661: Perform an unlock operation on the mutex lock.

[0101] In a specific embodiment, step S661 is used to release the lock after the channel is created.

[0102] S662: Request target data from the downstream and store it in the target channel.

[0103] In this specific embodiment, step S662 is responsible for calling the function call() of the downstream request, which is used to request the target data and store the requested target data in the ready channel.

[0104] S663: Close the target channel and broadcast the message that the target data has been cached.

[0105] In the embodiment of the present application, step S663 is used to close the ready channel and broadcast a message that the data is ready to other waiting goruntine.

[0106] S670: Return target data.

[0107] This specific embodiment describes a single-plane mechanism based on a channel, which realizes multiplexing in a financial scenario and has the following advantages:

[0108] (1) Implemented multiplexing in financial scenarios: The multiplexing mechanism was used to solve the problem of request merging and resource utilization optimization in high-concurrency scenarios, improving the performance and stability of the entire system.

[0109] (2) Solved the data race problem: When processing shared resources in financial scenarios, a synchronization mechanism based on channel creation and closing is adopted. By closing the ready channel before the broadcast events received by other goroutines, data consistency and stability are ensured, avoiding the data race problem.

[0110] (3) Unified downstream request and concurrent call scheduling: This feature enables the downstream (mid- and back-end) service to be called only once when multiple requests are made to the same session, thus reducing system load and improving resource utilization and system stability.

[0111] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0112] The embodiment of the present invention can divide the data access device into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0113] The present disclosure provides a data access device. Figure 7 As shown, the data access device 700 may include a request receiving module 710, a channel creating module 720, a data acquiring module 730 and a data access module 740, wherein:

[0114] The request receiving module 710 may be used to receive a data access request;

[0115] The channel creation module 720 may be used to determine the repeated requests in the data access request based on the parameter information of the data access request, and to create a target channel based on the first repeated request in the repeated requests; wherein the first repeated request is any data access request in the repeated requests;

[0116] A data acquisition module 730 is used to acquire target data corresponding to the first repeated request based on the target channel and close the target channel;

[0117] The data access module 740 is used to return target data.

[0118] In the embodiment of the present application, the channel creation module is specifically used to: obtain parameter information of a data access request; and when it is determined that the parameter information is the same, determine that the data access request with the same parameter information is a duplicate request.

[0119] In an embodiment of the present application, the above-mentioned data access device also includes a judgment module, which is specifically used to: obtain the mutual exclusion lock of the global variable corresponding to the target data; determine whether there is cache data corresponding to the data access request in the current session; if it is determined that there is cache data corresponding to the data access request in the current session, the above-mentioned channel creation module is specifically used to: unlock the mutual exclusion lock.

[0120] In an embodiment of the present application, if it is determined that there is no cache data corresponding to the data access request in the current session, the above-mentioned channel creation module is specifically used to: obtain any data access request in the repeated requests, and take any data access request as the first repeated request; establish a target channel for the first repeated request, and store the target channel to a global variable; unlock the mutex lock.

[0121] In the embodiment of the present application, the above-mentioned data acquisition module is specifically used to: request target data from the downstream system and store the target data in the target channel.

[0122] In the embodiment of the present application, the above-mentioned data access module is specifically used to: broadcast a first message, the first message is used to indicate that the target data has been cached; and return the target data corresponding to the repeated request to the data requester.

[0123] In an embodiment of the present application, the above-mentioned data access module is also used to: determine whether the target data is cached; if the target data is not cached, continue to cache the target data; if the target data is cached, return the target data.

[0124] In addition, the specific implementation details of the above-mentioned data access device have been described in detail in the corresponding position of the data access method, so they will not be repeated here.

[0125] Figure 8 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 8 , which shows a structural schematic diagram of an electronic device 800 suitable for implementing the embodiments of the present disclosure. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0126] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803 to implement the voice control method of the embodiment described in the present disclosure. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0127] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0128] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart, thereby implementing the voice control method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0129] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0130] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0131] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0132] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0133] receiving data access requests;

[0134] Determine a repeated request in the data access request based on parameter information of the data access request, and create a target channel based on a first repeated request in the repeated request; wherein the first repeated request is any data access request in the repeated request;

[0135] Acquire target data corresponding to the first repeated request based on the target channel, and close the target channel;

[0136] Returns the target data.

[0137] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0138] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0139] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0140] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0141] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0142] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0143] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0144] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0145] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A data access method, characterized in that: include: receiving data access requests; Determine a repeated request in the data access request based on parameter information of the data access request, and create a target channel based on a first repeated request in the repeated requests; wherein the first repeated request is any one of the data access requests in the repeated requests; Acquire target data corresponding to the first repeated request based on the target channel, and close the target channel; Returns the target data.

2. The data access method according to claim 1, characterized in that: The determining, based on the parameter information of the data access request, a repeated request in the data access request comprises: Acquiring the parameter information of the data access request; When it is determined that the parameter information is the same, the data access request with the same parameter information is determined to be the repeated request.

3. The data access method according to claim 1, characterized in that: Before creating the target channel based on the first repeated request in the repeated requests, the method further includes: Obtaining the mutex lock of the global variable corresponding to the target data; Determine whether there is cache data corresponding to the data access request in the current session; If it is determined that the cache data corresponding to the data access request exists in the current session, the method further includes: An unlock operation is performed on the mutex lock.

4. The data access request according to claim 3, characterized in that: If it is determined that the cache data corresponding to the data access request does not exist in the current session, creating a target channel based on the first repeated request in the repeated requests includes: Obtain any data access request in the repeated requests, and use the any data access request as the first repeated request; Establishing the target channel for the first repeated request, and storing the target channel in the global variable; An unlock operation is performed on the mutex lock.

5. The data access method according to claim 4, characterized in that: The acquiring target data corresponding to the first repeated request based on the target channel includes: The target data is requested from a downstream system, and the target data is stored in the target channel.

6. The data access method according to claim 4, characterized in that: The returning the target data comprises: Broadcasting a first message, where the first message is used to indicate that the target data has been cached; The target data corresponding to the repeated request is returned to the data requester.

7. The data access method according to claim 3, characterized in that: If it is determined that the cache data corresponding to the data access request exists in the current session, after unlocking the mutex, returning the target data includes: Determine whether the target data is cached; If the target data has not been cached, continue to cache the target data; If the target data is cached, the target data is returned.

8. A data access device, characterized in that: include: A request receiving module, used for receiving a data access request; a channel creation module, configured to determine the repeated requests in the data access request based on the parameter information of the data access request, and to create a target channel based on the first repeated request in the repeated requests; wherein the first repeated request is any one of the data access requests in the repeated requests; A data acquisition module, configured to acquire target data corresponding to the first repeated request based on the target channel, and close the target channel; The data access module is used to return the target data.

9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.