Business data acquisition method and device and storage medium
By setting up the ingress server and authentication server clusters in a unified manner, the business data acquisition process of diagnostic equipment when diagnosing online functions is simplified, the complex problem of obtaining business data in the existing technology is solved, and more efficient and convenient data acquisition is achieved.
Patent Information
- Application Number
- CN202411278436.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-01-10
AI Technical Summary
The prior art has complex process of obtaining business data when diagnosing online functions, which makes it difficult to develop and maintain diagnostic equipment and it is difficult to provide business data that meets diagnostic requests.
By setting the entry server in a unified manner, receiving service data acquisition requests, configuring the service data request parameters passed into the entry server, calling the authentication server cluster for authentication, if passed, the request parameters will be sent to the service server cluster to obtain service processing data, simplifying the acquisition The process of business data.
The process of obtaining the business data required by diagnostic equipment when diagnosing online functions is simplified, improving convenience and efficiency, and reducing the difficulty of development and maintenance.
Smart Images

Figure CN119293110A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and storage medium for acquiring business data. Background Art
[0002] When using diagnostic equipment to diagnose online functions, it is necessary to obtain corresponding business data based on different business needs. Business data is the criterion for judging whether the online diagnostic function can operate normally. At present, the separate business data of each online function is obtained by directly calling the server interface corresponding to the online function. Therefore, in the face of reasonable authentication or adjustment of business needs added during the diagnosis process, it is necessary to adjust each online function service interface one by one to obtain business data that meets the requirements. The process of adjusting the online function service interface one by one to obtain business data that meets the requirements is complicated, which makes the development and maintenance of online diagnostic functions using diagnostic equipment more difficult, and it is difficult to provide business data that meets the diagnostic requests.
[0003] Therefore, how to more efficiently and conveniently obtain the business data required for the online diagnosis function of the diagnostic equipment has become a technical problem that needs to be urgently solved in this application.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a business data acquisition method, device and storage medium, aiming to solve the technical problem of how to more efficiently and conveniently obtain the business data required for the online diagnosis function of the diagnostic device.
[0006] To achieve the above objectives, the present application proposes a method for acquiring business data, which is applied to a diagnostic device. The method comprises:
[0007] Receive business data acquisition request;
[0008] Configure the business data request parameters transmitted to the entry server according to the business data acquisition request;
[0009] Based on the entry server calling the authentication server cluster to authenticate the service data request parameters, obtaining an authentication result;
[0010] When the authentication result is passed, the service data request parameter is sent to the service server cluster to obtain service processing data.
[0011] In one embodiment, after the step of configuring the service data request parameters transmitted to the ingress server according to the service data acquisition request, the step further includes:
[0012] The business data request parameters are uniformly written into the log server record of the entry server.
[0013] In one embodiment, the step of authenticating the service data request parameters based on the entry server calling the authentication server cluster to obtain the authentication result includes:
[0014] Calling an authentication server cluster based on the entry server, wherein the authentication server cluster includes one or more of a legitimacy authentication server, a request service type authority authentication server, and an access policy authentication server;
[0015] Performing legitimacy authentication on the service data request parameters according to the legitimacy authentication server;
[0016] If the legality authentication is passed, the request service type authority authentication server is called to perform the request service type authority authentication on the service data request parameter to obtain the authentication result;
[0017] If the legality authentication fails, an authentication error code is returned, and the authentication error code is written into the log server record of the entry server to obtain an authentication result of failed authentication.
[0018] In one embodiment, the step of calling the request service type authority authentication server to perform request service type authority authentication on the service data request parameter to obtain the authentication result includes:
[0019] Calling the requested service type authority authentication server to perform requested service type authority authentication on the service data request parameters;
[0020] If the requested business type authority authentication passes, calling the access policy authentication server to perform access authority authentication on the business data request parameters to obtain an authentication result;
[0021] If the requested business type authority authentication fails, an unauthorized error code is returned, and the unauthorized error code is written into the log server record to obtain an authentication result of unsuccessful authentication.
[0022] In one embodiment, the step of calling the access policy authentication server to perform access policy authentication on the service data request parameter to obtain the authentication result includes:
[0023] Calling the access policy authentication server to perform access policy authentication on the service data request parameters;
[0024] If the access policy authentication is passed, an authentication result of passed authentication is obtained;
[0025] If the access policy authentication fails, a policy non-compliance error code is returned, and the policy non-compliance error code is written into the log server record to obtain an authentication result of authentication failure.
[0026] In one embodiment, when the authentication result is passed, the step of sending the service data request parameter to a service server cluster to obtain service processing data includes:
[0027] When the authentication result is passed, the service data request parameter is sent to the service server cluster to determine whether the service server cluster meets the current service processing requirements;
[0028] If the business server cluster meets the current business processing requirements, the business data request parameters are distributed to the single business server to obtain business processing data;
[0029] If the service server cluster does not meet the current service processing requirements, an unsupported service error code is returned, and the unsupported service error code is recorded in the log server record of the entry server.
[0030] In one embodiment, the step of distributing the service data request parameters to a single service server to obtain service processing data includes:
[0031] Distribute the business data request parameters to a single business server for parsing to obtain business processing logic;
[0032] Business processing is performed according to the business processing logic to obtain business processing data.
[0033] In addition, to achieve the above purpose, the present application also proposes a business data acquisition method, which is applied to an online function server side, wherein the online function server side includes one or more of an entry server, an authentication server cluster, and a business server cluster, and the method includes:
[0034] The entry server receives the service data request parameters configured according to the service data acquisition request;
[0035] The authentication server cluster authenticates the service data request parameters to obtain an authentication result;
[0036] When the authentication result is passed, the business server cluster processes the business data request parameters to obtain business processing data.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a business data acquisition device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the business data acquisition method described above.
[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the business data acquisition method described above are implemented.
[0039] One or more technical solutions proposed in this application have at least the following technical effects:
[0040] The entry server is uniformly set up, and the business data request parameters transmitted to the entry server are configured according to the request for obtaining business data. The business data request parameters are transmitted to the entry server, and the authentication server cluster is called to authenticate the business data request parameters. The newly added online authentication and permission control are uniformly processed by the authentication server cluster. The authenticated business data request parameters will be further transmitted to the business server cluster to obtain the corresponding business processing data. The entry server and the authentication server cluster uniformly process the newly added authentication and permission control. The business server cluster only focuses on its own functional business and does not need to process each online functional interface separately, which simplifies the operation of obtaining business data, so that the business data required by the diagnostic equipment when diagnosing online functions can be more conveniently obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A flowchart of the first embodiment of the method for acquiring business data of the present application is provided;
[0044] Figure 2 A flowchart of the second embodiment of the method for acquiring business data of the present application is provided;
[0045] Figure 3 A flowchart of the third embodiment of the method for acquiring business data of the present application is provided;
[0046] Figure 4 A brief flowchart of the method for obtaining business data for this application;
[0047] Figure 5 A flowchart of the fifth embodiment of the method for acquiring business data of the present application is provided;
[0048] Figure 6 This is a schematic diagram of the module structure of the business data acquisition device according to an embodiment of the present application;
[0049] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the business data acquisition method in the embodiment of the present application.
[0050] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0053] The main solution of the embodiment of the present application is: through a unified authentication server cluster, the reasonable authority authentication and business demand adjustment that may be added when the diagnostic equipment diagnoses the online function are processed, and the business server cluster focuses on obtaining the business data required by the diagnostic equipment diagnosis online function according to the business data acquisition request. When using the online function of online equipment diagnosis, the business data request parameters transmitted to the entry server are configured according to the changes in business requests such as reasonable authentication and authority control added during the diagnosis process. The entry server calls the authentication server interface for authentication. After the authentication is passed, the business data request parameters are uniformly processed by the business server cluster to obtain business processing data.
[0054] The embodiments of the present application take into account that: when using diagnostic equipment to diagnose online functions, it is necessary to temporarily add reasonable authentication and permission restriction steps to ensure the data security of online functions. At present, each function is processed separately. If it is necessary to make business adjustments to the online functions, such as adding verification of legitimacy, since the original online function interfaces do not have a unified processing logic, it is necessary to adjust each online function interface to obtain business processing data that meets the requirements. However, adjusting each online function interface is not only complicated to operate, but also difficult to develop and maintain, and it is difficult to provide business data that meets the diagnostic request.
[0055] Therefore, the present application provides a solution. When using the diagnostic device to diagnose online functions, a unified entry server is set up, and the business data request parameters transmitted to the entry server are configured according to the request for obtaining business data. The business data request parameters are transmitted to the entry server, and the authentication server cluster is called to authenticate the business data request parameters. Since the business data request parameters include parameters representing the newly added reasonable authentication and authority control steps, the newly added online authentication and authority control are uniformly processed by the authentication server cluster, and the authenticated business data request parameters will be further transmitted to the business server cluster to obtain the corresponding business processing data. The newly added authentication and authority control are uniformly processed by the entry server and the authentication server cluster. The business server cluster only focuses on its own functional business and does not need to process each online functional interface separately, which simplifies the operation of obtaining business data, so that the business data required by the diagnostic device when diagnosing online functions can be more conveniently obtained.
[0056] Based on this, the embodiment of the present application provides a method for obtaining business data, which is applied to a diagnostic device, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the business data acquisition method of the present application.
[0057] In this embodiment, the business data acquisition method includes steps S10 to S40:
[0058] Step S10, receiving a request for obtaining business data;
[0059] A business data acquisition request is a request sent by a diagnostic device to a server, which is intended to obtain specific business-related data from the server or perform business logic-related operations. It usually includes a series of parameters and instructions to instruct the server on how to respond to the request and return the required data or execution results.
[0060] When using diagnostic equipment to diagnose some online functions, it is necessary to correspond to server data according to different business requests, and add some reasonable authentication and permission control, such as whether it is a pirated device, whether it has value-added service functions, whether it exceeds the usage area, etc. Therefore, business data acquisition requests pay special attention to business request correspondence, authentication, permission control, business logic verification and other aspects.
[0061] Taking JSON as the request format for business data acquisition requests as an example, deviceInfo can be used to define basic information about the device, such as device ID, type, serial number, and firmware version. This information can be used to verify the legitimacy and functional compatibility of the device, thereby achieving reasonable authentication and permission control added to the server data corresponding to different business requests.
[0062] Step S20, configuring the service data request parameters transmitted to the entry server according to the service data acquisition request;
[0063] Based on the business data acquisition request, configuring the business data request parameters passed into the entry server usually involves encapsulating the necessary authentication information, device information, business request details and any related verification parameters into a request body (usually in JSON format), which is then sent to the server via an HTTP request.
[0064] It should be noted that the service data request parameters include: diagnostic connector information (serial number SN, connector mac address); requested service type; device hardware information (including device model, mac address, terminal unique identifier, etc.); used diagnostic software; geographical location of the diagnostic device; requested service data (using json string data to organize the request data), etc.
[0065] The extensibility of business request parameters allows the addition of new business types or data fields without modifying the basic structure of the API. By adding or modifying data fields, different authentication requirements and permission controls added when diagnosing the online function of the diagnostic device can be processed, which improves the flexibility and maintainability of obtaining business processing data.
[0066] Step S30, based on the entry server calling the authentication server cluster to authenticate the service data request parameters, to obtain an authentication result;
[0067] The business data request parameters are passed to the entry server. The entry server calls the authentication server to authenticate the business data request parameters and identify the permissions. First, the business data request parameters (including diagnostic connector information, requested business type, device hardware information, used diagnostic software, diagnostic device geographic location, and requested business data, etc.) need to be packaged into a request body (usually in JSON format) and sent to the entry server via an HTTP request.
[0068] Furthermore, the entry server sends the constructed HTTP request to the authentication server cluster, which checks the information in the request and compares it with the stored user data, permission data, etc. to verify the legitimacy of the request and the user's authority, thereby obtaining an authentication result.
[0069] Step S40: When the authentication result is passed, the service data request parameter is sent to the service server cluster to obtain service processing data.
[0070] When the authentication result of the authentication server cluster is passed, the service data request parameters and any additional information that may be obtained from the authentication server are sent to the service server cluster. The service server cluster receives the service data request parameters, performs corresponding service logic processing according to the parameters, and generates service processing data. The service processing data may include query results, calculation results, status information, etc., but the specific information depends on the service type in the service data request parameters.
[0071] This embodiment provides a business data acquisition method, which is applied to diagnostic equipment. By uniformly setting up an entry server, the business data request parameters transmitted to the entry server are configured according to the request for obtaining business data, the business data request parameters are transmitted to the entry server, and the authentication server cluster is called to authenticate the business data request parameters. The newly added online authentication and authority control are uniformly processed by the authentication server cluster, and the authenticated business data request parameters will be further transmitted to the business server cluster to obtain the corresponding business processing data. The newly added authentication and authority control are uniformly processed by the entry server and the authentication server cluster. The business server cluster only focuses on its own functional business and does not need to process each online functional interface separately, thereby simplifying the business data acquisition operation, so that the business data required by the diagnostic equipment when diagnosing online functions can be more conveniently obtained.
[0072] Based on the first embodiment of the present application, the second embodiment of the present application is proposed. In the second embodiment of the present application, the same or similar contents as those of the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following.
[0073] On this basis, please refer to Figure 2 , Figure 2 A flowchart of a second embodiment of the business data acquisition method provided in this application.
[0074] In this embodiment, after step S20 of configuring the service data request parameters transmitted to the entry server according to the service data acquisition request, step S201 is also included:
[0075] Step S201, uniformly write the service data request parameters into the log server record of the entry server.
[0076] Writing business data request parameters uniformly into the log server record of the entry server is of great significance for system monitoring, troubleshooting, security auditing, and performance optimization. The business data request parameters are uniformly recorded in the log server on the entry server, and the returned data is subsequently recorded in the log server, which facilitates the subsequent tracing and positioning of online function requests. When the system fails or is abnormal, log records are an important basis for troubleshooting. By viewing the business data request parameters recorded in the log, you can quickly locate the source of the problem, understand the specific content of the request, and then analyze the cause of the problem. This is of great significance for quickly restoring the normal operation of the system and reducing user losses.
[0077] First, a log table suitable for storing business data request parameters needs to be designed in the entry server. This table should contain enough fields to record the source, parameters, time and other information of the request.
[0078] Furthermore, the logging logic is implemented in the code of the entry server. When a business data request is received, the request parameters are written into the log table, and AOP (Aspect-Oriented Programming) is used to simplify the implementation of logging.
[0079] Furthermore, log levels and filtering rules can be set according to actual needs. For important or abnormal requests, a higher log level can be set for recording; for unimportant or repeated requests, a lower log level can be set or filtering can be performed. In order to prevent the problem of insufficient storage space due to excessively large log files, log rotation and cleanup strategies need to be set. Old log files can be compressed and stored or deleted regularly to free up storage space.
[0080] Finally, log query and analysis tools are provided to facilitate viewing and analyzing log server records. Log query and analysis tools should support multiple query conditions and time range selections to quickly locate the log records that need to be viewed.
[0081] In this embodiment, the business data request parameters are uniformly written into the log server record of the entry server, and the returned data are subsequently recorded in the log server to facilitate the subsequent tracing and positioning of the online function request.
[0082] Based on the first embodiment and / or the second embodiment of the present application, the third embodiment of the present application is proposed. In the third embodiment of the present application, the same or similar contents as those of the above-mentioned first and second embodiments can be referred to the above introduction, and will not be repeated in the following.
[0083] On this basis, please refer to Figure 3 , Figure 3 A flowchart of a third embodiment of the business data acquisition method provided in this application.
[0084] In this embodiment, based on the entry server calling the authentication server cluster to authenticate the service data request parameters, step S30 of obtaining the authentication result may include steps S301 to S304:
[0085] Step S301, calling an authentication server cluster based on the entry server, wherein the authentication server cluster includes one or more of a legitimacy authentication server, a request service type authority authentication server, and an access authority authentication server;
[0086] When the diagnostic device requests an online function, the business data request parameters are passed to a unified entry server, and the authentication server cluster is uniformly called according to the entry server, where the authentication server cluster includes one or more of a legitimacy authentication server, a request business type authority authentication server, and an access rights authentication server.
[0087] The legitimacy authentication server verifies the legitimacy of the connector and equipment in the business data request parameters; the requested business type authority authentication server authenticates whether the diagnostic software used by the corresponding diagnostic connector in the business data request parameters has the authority to request the business type; the access permission authentication server determines whether the requested business type requirements in the business data request parameters comply with the access policy of the corresponding business.
[0088] Step S302, performing legitimacy authentication on the service data request parameters according to the legitimacy authentication server;
[0089] Since the service data request parameters include diagnostic connector information (serial number SN, connector mac address) and device hardware information (including device model, mac address, terminal unique identifier, etc.), the service data request parameters can be authenticated based on the legitimacy authentication server.
[0090] Step S303: If the legality authentication is passed, the request service type authority authentication server is called to perform the request service type authority authentication on the service data request parameter to obtain an authentication result;
[0091] First, the legitimacy of the corresponding connector and device is verified. The corresponding device model, MAC address, and terminal unique identifier in the business data request parameters are used to determine whether the connector belongs to the corresponding device; and whether it is used in the defined sales area according to the location of the diagnostic device. If the above legitimacy authentication is passed, the business type authorization authentication server is called to authenticate the business data request parameters and obtain the final authentication result.
[0092] Step S304: If the legality authentication fails, an authentication error code is returned, and the authentication error code is written into the log server record of the entry server to obtain an authentication result of failed authentication.
[0093] If the legality authentication fails, the authentication error code is returned and written into the log server record of the entry server, and the authentication result of authentication failure is obtained. The authentication result of authentication failure means that the online diagnosis function of the diagnostic device does not meet some additional reasonable authentication and permission control, and the corresponding server business data cannot be obtained.
[0094] Specifically, in a feasible implementation manner, step S303 may include steps S1 to S3:
[0095] Step S1, calling the requested service type authority authentication server to perform requested service type authority authentication on the service data request parameters;
[0096] The service type authorization authentication server is called to perform service type authorization authentication on the diagnostic software usage information contained in the service data request parameter, and determine whether the diagnostic software used by the corresponding diagnostic connector has the authorization for the requested service type.
[0097] Step S2: If the requested service type authority authentication is passed, calling the access policy authentication server to perform access policy authentication on the service request parameters to obtain an authentication result;
[0098] If the diagnostic software used by the corresponding diagnostic connector has the authority to request the service type, the requested service type authority authentication is passed, and the access policy authentication server is called to perform access authority authentication on the service request parameters.
[0099] Furthermore, if the requested business type authority authentication is passed, then the business data acquisition request is judged whether it complies with the access policy of the corresponding business according to the requested business type in the business data request parameter. If it complies, the access policy authentication is passed, and the authentication result of authentication passing is obtained. If it does not comply, the access policy authentication fails, and an error code of non-compliance with the policy is returned, and the error code is written into the log server record, and the authentication result of authentication failure is obtained.
[0100] Step S3: If the requested business type authority authentication fails, a no-authority error code is returned, and the no-authority error code is written into the log server record to obtain an authentication result of failed authentication.
[0101] If the diagnostic software used by the corresponding diagnostic connector does not have the permission to request the business type, the requested business type permission authentication fails, and an unauthorized error code is returned. The unauthorized error code is written into the log server record of the entry server, and an authentication result of unsuccessful authentication is obtained.
[0102] The above is only a feasible implementation of step S303 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S303.
[0103] In this embodiment, the authentication server cluster is called according to the entry server, wherein the authentication server cluster includes one or more of a legitimacy authentication server, a request service type authority authentication server, and an access policy authentication server. The various authentication servers in the authentication server cluster are called one by one to authenticate the service data request parameters. Only when all authentications are passed can the authentication result of passing the authentication be obtained. If any authentication server in the authentication server cluster fails to authenticate, the authentication result is failure, and the error code corresponding to the authentication failure needs to be recorded in the log server record of the entry server, so as to facilitate the subsequent tracing and positioning of online function requests. The reasonable authentication and authority control added in the process of corresponding server data according to different service requests when using diagnostic equipment to diagnose online functions are uniformly processed using the authentication server cluster, and the service server interface of the online function is no longer adjusted separately, which simplifies the process of obtaining service processing data, and more conveniently and efficiently obtains the service data required by the diagnostic equipment to diagnose online functions, reducing the difficulty of development and maintenance.
[0104] Based on the above embodiments of the present application, a fourth embodiment of the present application is proposed. In the fourth embodiment of the present application, the same or similar contents as those of the above embodiments can be referred to the above introduction, and will not be described in detail later.
[0105] In this embodiment, when the authentication result is passed, the step S40 of sending the service data request parameter to the service server cluster to obtain service processing data may include steps S401 to S403:
[0106] Step S401, when the authentication result is passed, the service data request parameter is sent to the service server cluster to determine whether the service server cluster meets the current service processing requirements;
[0107] The business data request parameters pass all authentications of the authentication server cluster and obtain an authentication result of passing the authentication. When the authentication result is passing, the business data request parameters are sent to the business server cluster. Since the business data request parameters contain the requested business data using the json string data type, it can be determined whether the business server cluster can process the current business.
[0108] First, the request containing the business data request parameters is sent to the business server cluster. Since JSON strings are easy to read and write, and are also easy to parse and generate by machines, they are a common data exchange format in modern Web services. Therefore, the business data request parameters are encapsulated in a JSON string and sent to the business server cluster.
[0109] Furthermore, after receiving the request, a server in the business server cluster selected according to the load balancing strategy will first parse the JSON string in the request to obtain the requested business data contained in the business data request parameter.
[0110] Furthermore, after parsing the requested business data in the business data request parameter, the business server selected according to the load balancing strategy will further determine whether it or the entire cluster can handle the current business. The judgment process involves aspects such as business logic matching and resource availability judgment. Among them, business logic matching is used to determine whether the business type in the request matches the business type supported by the server or cluster; resource availability judgment is used to check whether the current resources of the server or cluster (such as CPU, memory, database connection, etc.) are sufficient to process the business request.
[0111] Step S402: if the business server cluster meets the current business processing requirements, the business data request parameters are distributed to the individual business servers to obtain business processing data;
[0112] If the business server cluster is capable of processing the current business, the business data request parameters are further distributed to the individual business servers to obtain business processing data.
[0113] Step S403: If the service server cluster does not meet the current service processing requirements, a service unsupported error code is returned, and the service unsupported error code is recorded in the log server record of the entry server.
[0114] If the business server cluster cannot handle the current business, it returns an error code indicating that the business is not supported, and records the error code in the log server record of the entry server to facilitate subsequent tracing and positioning of online function requests.
[0115] Specifically, in a feasible implementation manner, step S402 may include steps A1 to A2:
[0116] Step A1, distributing the service data request parameters to a single service server for parsing to obtain service processing logic;
[0117] Business server clusters usually use load balancers to distribute business data request parameters to individual business servers in the cluster. The load balancer selects a suitable server to handle the current request based on preset policies (such as polling, minimum number of connections, IP hash, etc.). Once the load balancer selects the target server, it routes the business data request parameters to the server. This structure usually involves forwarding operations at the network level to ensure that the business data request parameters can accurately reach the specified server.
[0118] After receiving the business data request parameters, the selected single business server will further parse the business data request parameters to obtain the business processing logic for processing the business data request parameters.
[0119] Step A2: performing business processing according to the business processing logic to obtain business processing data.
[0120] The single business server generates business processing data according to the business processing logic. The business processing data may include query results, calculation results, status information or other business-related data, which are usually returned in JSON, XML or other structured formats. The single business server encapsulates the business processing data in the response and sends it to the entry server through the network, and writes the returned data to the log server record of the entry server.
[0121] The above is only a feasible implementation of step S402 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S402.
[0122] In this embodiment, after the business data request parameters are authenticated by the business server cluster, the business data request parameters are distributed to the business server cluster to determine whether the business server cluster can handle the current business, further ensuring the acquisition of business processing data. If the business server cluster can handle the current business, the business data request parameters are distributed to the single business server to obtain the business processing data; if the business server cluster cannot meet the current business, an error code indicating that the business is not supported is returned, and the error code indicating that the business is not supported is recorded in the log server record of the entry server, so as to facilitate the subsequent tracing and positioning of online function requests. The business processing server only focuses on the acquisition of business processing data. The reasonable authentication and authority control added when diagnosing the online function of the equipment are processed by a unified authentication server cluster, and the business processing data is recorded in the log server record of the entry server for subsequent unified access, so as to obtain business processing data more efficiently and conveniently.
[0123] like Figure 4 As shown, Figure 4 The overall process diagram of obtaining business processing data provided by the business data acquisition method of this application. Figure 4The overall steps for obtaining business data are described in detail.
[0124] First, the business data request parameters are passed into the entry server cluster, and the entry server cluster calls the authentication server cluster to authenticate the business data request parameters.
[0125] Furthermore, if the authentication server cluster successfully authenticates the business data request parameters, the business server cluster is called to process the business data request parameters to obtain business processing data; if the authentication server cluster fails to authenticate the business data request parameters, a corresponding error code is returned and recorded in the log server record.
[0126] Furthermore, when the authentication server cluster authenticates the service data request parameters, the service server cluster is called to determine whether the service server cluster can process the current service. If the service server cluster can process the current service, the service data request parameters are distributed to the single service cluster for service processing to obtain service processing data; if the service server cluster cannot process the current service, an error code indicating that the service is not supported is returned and the error code is recorded in the log server record.
[0127] The fifth embodiment of the present application proposes a business data acquisition method applied to an online function server, wherein the online function server includes one or more of an entry server, an authentication server cluster, and a business server cluster. Figure 5 , Figure 5 This is a flow chart of the fifth embodiment of the business data acquisition method of the present application.
[0128] In this embodiment, the business data acquisition method includes steps A10 to A30:
[0129] Step A10, the entry server receives the service data request parameters configured according to the service data acquisition request;
[0130] The service data request parameters include: diagnostic connector information (serial number SN, connector mac address); requested service type; device hardware information (including device model, mac address, terminal unique identifier, etc.); used diagnostic software; geographical location of the diagnostic device; requested service data (using json string data to organize the request data), etc. The entry server receives the service data request parameters configured according to the service data acquisition request, so as to subsequently call the authentication server cluster for further processing.
[0131] Step A20, the authentication server cluster authenticates the service data request parameters to obtain an authentication result;
[0132] The authentication server cluster parses the business data request parameters stored in the entry server, and parses the business data request parameters in JSON format to obtain various data including diagnostic connector information, requested business type, device hardware information, used diagnostic software, diagnostic device geographic location, and requested business data.
[0133] Step A30: When the authentication result is passed, the business server cluster processes the business data request parameters to obtain business processing data.
[0134] When the authentication result is passed, the business server cluster selects a server in the business server cluster according to the load balancing strategy to determine whether the business server cluster can handle the current business. Among them, the business logic matching is used to determine whether the business type in the request matches the business type supported by the server or cluster; the resource availability judgment is used to check whether the current resources of the server or cluster (such as CPU, memory, database connection, etc.) are sufficient to process the business request.
[0135] If the business server cluster cannot handle the current business, it returns an error code indicating that the business is not supported, and records the error code in the log server record of the entry server to facilitate subsequent tracing and positioning of online function requests.
[0136] If the business server cluster is capable of processing the current business, the business data request parameters are further distributed to the individual business servers to obtain business processing data.
[0137] This embodiment provides a business data acquisition method, which is applied to an online function server side. The entry server receives business data request configuration parameters configured according to the business data request. After the business data request configuration parameters of the entry server are passed in, the authentication server cluster is called to authenticate the business data request parameters to obtain an authentication result. The newly added online authentication and authority control are uniformly processed by the authentication server cluster, and the authenticated business data request parameters will be further passed to the business server cluster to obtain the corresponding business processing data. The entry server and the authentication server cluster uniformly process the newly added authentication and authority control. The business server cluster only focuses on its own functional business and does not need to process each online function interface separately, thereby simplifying the business data acquisition operation, so that the business data required by the diagnostic device when diagnosing online functions can be more conveniently obtained.
[0138] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the business data acquisition method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0139] This application also provides a business data acquisition device, please refer to Figure 6 , the business data acquisition device comprises:
[0140] A request acquisition module 10, used to receive a business data acquisition request;
[0141] A business data acquisition request is a request sent by a diagnostic device to a server, which is intended to obtain specific business-related data from the server or perform business logic-related operations. It usually includes a series of parameters and instructions to instruct the server on how to respond to the request and return the required data or execution results.
[0142] A parameter configuration module 20, configured to configure the service data request parameters transmitted to the ingress server according to the service data acquisition request;
[0143] Based on the business data acquisition request, configuring the business data request parameters passed into the entry server usually involves encapsulating the necessary authentication information, device information, business request details and any related verification parameters into a request body (usually in JSON format), which is then sent to the server via an HTTP request.
[0144] An authentication module 30 is used to authenticate the service data request parameters according to the ingress server calling the authentication server cluster to obtain an authentication result;
[0145] The business data request parameters are passed to the entry server. The entry server calls the authentication server to authenticate the business data request parameters and identify the permissions. First, the business data request parameters (including diagnostic connector information, requested business type, device hardware information, used diagnostic software, diagnostic device geographic location, and requested business data, etc.) need to be packaged into a request body (usually in JSON format) and sent to the entry server via an HTTP request.
[0146] Furthermore, the entry server sends the constructed HTTP request to the authentication server cluster, which checks the information in the request and compares it with the stored user data, permission data, etc. to verify the legitimacy of the request and the user's authority, thereby obtaining an authentication result.
[0147] The business processing data acquisition module 40 sends the business data request parameters to the business server cluster to acquire business processing data when the authentication result is passed.
[0148] When the authentication result of the authentication server cluster is passed, the service data request parameters and any additional information that may be obtained from the authentication server are sent to the service server cluster. The service server cluster receives the service data request parameters, performs corresponding service logic processing according to the parameters, and generates service processing data.
[0149] The business data acquisition device provided by the present application adopts the business data acquisition method in the above embodiment, which can solve the technical problem of business data acquisition. Compared with the prior art, the beneficial effects of the business data acquisition device provided by the present application are the same as the beneficial effects of the business data acquisition method provided by the above embodiment, and other technical features in the business data acquisition device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0150] The present application provides a business data acquisition device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the business data acquisition method in the above-mentioned embodiment one.
[0151] Reference below Figure 7 , which shows a schematic diagram of the structure of a business data acquisition device suitable for implementing the embodiment of the present application. The business data acquisition device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The business data acquisition 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 application.
[0152] like Figure 7As shown, the business data acquisition device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the business data acquisition device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the business data acquisition device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a business data acquisition device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0153] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0154] The business data acquisition device provided by the present application adopts the business data acquisition method in the above embodiment to solve the technical problem of business data acquisition. Compared with the prior art, the beneficial effects of the business data acquisition device provided by the present application are the same as the beneficial effects of the business data acquisition method provided by the above embodiment, and other technical features in the business data acquisition device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0155] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0156] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0157] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the business data acquisition method in the above-mentioned embodiment.
[0158] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, 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 this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0159] The computer-readable storage medium may be included in the business data acquisition device; or may exist independently without being assembled into the business data acquisition device.
[0160] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the business data acquisition device, the business data acquisition device: receives a business data acquisition request; configures the business data request parameters transmitted to the entry server according to the business data acquisition request; based on the entry server, calls the authentication server cluster to authenticate the business data request parameters to obtain an authentication result; when the authentication result is passed, sends the business data request parameters to the business server cluster to obtain business processing data.
[0161] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including 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 the case of 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., via the Internet using an Internet service provider).
[0162] 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 application. 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 alternative implementations, 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.
[0163] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0164] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned business data acquisition method, and can solve the technical problem of business data acquisition. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the business data acquisition method provided by the above-mentioned embodiment, and will not be repeated here.
[0165] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned business data acquisition method when executed by a processor.
[0166] The computer program product provided by this application can solve the technical problem of business data acquisition. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the business data acquisition method provided by the above embodiment, which will not be repeated here.
[0167] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for acquiring business data, characterized in that: Applied to diagnostic equipment, the method comprises: Receive business data acquisition request; Configure the business data request parameters transmitted to the entry server according to the business data acquisition request; Based on the entry server calling the authentication server cluster to authenticate the service data request parameters, obtaining an authentication result; When the authentication result is passed, the service data request parameter is sent to the service server cluster to obtain service processing data.
2. The method according to claim 1, characterized in that After the step of configuring the service data request parameters transmitted to the inlet server according to the service data acquisition request, the following step further comprises: The business data request parameters are uniformly written into the log server record of the entry server.
3. The method according to claim 1, characterized in that The step of authenticating the service data request parameters based on the entry server calling the authentication server cluster to obtain the authentication result includes: Calling an authentication server cluster based on the entry server, wherein the authentication server cluster includes one or more of a legitimacy authentication server, a request service type authority authentication server, and an access policy authentication server; Performing legitimacy authentication on the service data request parameters according to the legitimacy authentication server; If the legality authentication is passed, the request service type authority authentication server is called to perform the request service type authority authentication on the service data request parameter to obtain the authentication result; If the legality authentication fails, an authentication error code is returned, and the authentication error code is written into the log server record of the entry server to obtain an authentication result of failed authentication.
4. The method according to claim 3, characterized in that The step of calling the request service type authority authentication server to perform request service type authority authentication on the service data request parameter to obtain the authentication result comprises: Calling the requested service type authority authentication server to perform requested service type authority authentication on the service data request parameters; If the requested business type authority authentication passes, calling the access policy authentication server to perform access authority authentication on the business data request parameters to obtain an authentication result; If the requested business type authority authentication fails, an unauthorized error code is returned, and the unauthorized error code is written into the log server record to obtain an authentication result of unsuccessful authentication.
5. The method according to claim 4, characterized in that The step of calling the access policy authentication server to perform access policy authentication on the service data request parameters to obtain the authentication result comprises: Calling the access policy authentication server to perform access policy authentication on the service data request parameters; If the access policy authentication is passed, an authentication result of passed authentication is obtained; If the access policy authentication fails, a policy non-compliance error code is returned, and the policy non-compliance error code is written into the log server record to obtain an authentication result of authentication failure.
6. The method according to claim 1, characterized in that When the authentication result is passed, the step of sending the service data request parameter to the service server cluster to obtain service processing data includes: When the authentication result is passed, the service data request parameter is sent to the service server cluster to determine whether the service server cluster meets the current service processing requirements; If the business server cluster meets the current business processing requirements, the business data request parameters are distributed to the single business server to obtain business processing data; If the service server cluster does not meet the current service processing requirements, an unsupported service error code is returned, and the unsupported service error code is recorded in the log server record of the entry server.
7. The method according to claim 6, characterized in that The step of distributing the service data request parameters to a single service server to obtain service processing data comprises: Distribute the business data request parameters to a single business server for parsing to obtain business processing logic; Business processing is performed according to the business processing logic to obtain business processing data.
8. A method for acquiring business data, characterized in that: Applied to an online function server, the online function server includes one or more of an entry server, an authentication server cluster, and a business server cluster, and the method includes: The entry server receives the service data request parameters configured according to the service data acquisition request; The authentication server cluster authenticates the service data request parameters to obtain an authentication result; When the authentication result is passed, the business server cluster processes the business data request parameters to obtain business processing data.
9. A business data acquisition device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the business data acquisition method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the business data acquisition method according to any one of claims 1 to 8 are implemented.