Testing machine resource access method, device and system and testing machine

By using independent resource service processes to connect parallel to the business service processes in the test machine resource access, and using serialization and reflection mechanisms, the problem of low performance of the RPC framework is solved, the test machine resource access performance is improved and the system stability is enhanced.

CN119201654APending Publication Date: 2024-12-27HANGZHOU CHANGCHUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310714458.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing RPC distributed network framework has low performance in the access of test machine resources and cannot meet the needs of efficient access.

Method used

Through independent resource service processes, network connections are established in parallel with multiple business service processes, data transmission is achieved by combining serialization and reflection mechanisms, and the access performance of test machine resources is improved.

Benefits of technology

It realizes parallel access to test machine resources, improves access performance, and ensures system stability. Even if the business service process crashes, it will not affect the service provision of the resource service process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201654A_ABST
    Figure CN119201654A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a test machine resource access method, device and system and a test machine, and the method comprises the steps: receiving binary data sent by a first business service process, the binary data comprising a business access request of the first business service process and a serialization result corresponding to a request identifier; converting the binary data into a corresponding resource access request based on a reflection mechanism; determining a to-be-accessed target resource according to the resource access request, and obtaining a resource access result based on the target resource; serializing the resource access result and the request identifier to obtain a serialized access result; and sending the serialized access result to the first business service process through a connection channel between the serialized access result and the corresponding first business service process. According to the embodiment of the invention, the access performance of test machine resources can be greatly improved, and the problem that the requirement of a test machine user for calling a test machine interface at high frequency cannot be met in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of testing technology, and in particular to a method, device, system and testing machine for accessing testing machine resources. Background Art

[0002] In the field of testing technology, limited hardware resources of testing machines often need to provide services to multiple different users at the same time. In related technologies, the application of distributed services of testing machines is usually implemented through the RPC (Remote Procedure Call) distributed network framework. However, the RPC framework of related technologies has the problem of low access performance and cannot meet the demand for efficient access to the resource service interface of the testing machine. Summary of the invention

[0003] The embodiments of the present disclosure provide a method, device, system and test machine for accessing test machine resources to improve the access performance of the test machine.

[0004] A first aspect of the disclosed embodiment provides a method for accessing test machine resources, which is applied to a resource service process, and includes: receiving binary data sent by a first business service process, wherein the binary data includes a business access request of the first business service process and a serialization result corresponding to a request identifier;

[0005] Based on the reflection mechanism, convert the binary data into a corresponding resource access request;

[0006] Determine a target resource to be accessed according to the resource access request, and obtain a resource access result based on the target resource;

[0007] Serializing the resource access result and the request identifier to obtain a serialized access result;

[0008] The serialized access result is sent to the first business service process through a connection channel between the first business service process and the corresponding process.

[0009] In some optional embodiments of the present disclosure, the method of the present disclosure further includes:

[0010] Monitoring a connection status of at least one business service process, where the first business service process is any one of the at least one business service process;

[0011] After receiving a network connection request from any one of the at least one business service process, a network connection is established with the business service process.

[0012] In some optional embodiments of the present disclosure, determining a target resource to be accessed according to the resource access request, and obtaining a resource access result based on the target resource includes:

[0013] Determine a target resource to be accessed according to the resource access request, and determine a minimum resource to be locked according to the target resource;

[0014] After locking the minimum resource, the resource access result is obtained based on the target resource.

[0015] In some optional embodiments of the present disclosure, the binary data and the serialized access results are results obtained by serialization based on the Protobuf protocol; and the reflection mechanism is a reflection mechanism of the Protobuf protocol.

[0016] A second aspect of the disclosed embodiment provides a method for accessing test machine resources, which is applied to a business service process and includes:

[0017] Get the initial access request from the target application;

[0018] Generate a service access request and a request identifier according to the initial access request;

[0019] Serializing the service access request and the request identifier to obtain serialized binary data;

[0020] Sending the binary data to a resource service process, so that the resource service process obtains a serialized access result based on the binary data;

[0021] Receiving the serialized access result sent by the resource service process, and converting the serialized access result into a business access result based on a reflection mechanism;

[0022] The service access result is returned to the target application.

[0023] In some optional embodiments of the present disclosure, the method of the present disclosure further includes:

[0024] A network connection request is sent to the resource service process to establish a network connection with the resource service process.

[0025] In some optional embodiments of the present disclosure, sending the binary data to the resource service process includes:

[0026] Sending the binary data to the resource service process through a currently idle first sending thread;

[0027] The method further comprises:

[0028] After the first sending thread finishes sending the binary data, the first sending thread is controlled to enter a dormant state.

[0029] In some optional embodiments of the present disclosure, returning the service access result to the target application includes:

[0030] The corresponding access request thread is determined according to the request identifier, the waiting access request thread is awakened, and the service access result is returned to the target application through the access request thread.

[0031] In some optional embodiments of the present disclosure, serializing the service access request and the request identifier to obtain serialized binary data includes:

[0032] Serializing the service access request and the request identifier based on the serialization rule of the Protobuf protocol to obtain the serialized binary data;

[0033] The converting the serialized access result into a service access result based on a reflection mechanism includes:

[0034] The serialized access result is converted into a business access result based on the reflection mechanism of the Protobuf protocol.

[0035] According to a third aspect of the embodiments of the present disclosure, there is provided a device for accessing tester resources, including:

[0036] A first receiving module, configured to receive binary data sent by a first business service process, wherein the binary data includes a business access request of the first business service process and a serialization result corresponding to a request identifier;

[0037] A first processing module, configured to convert the binary data into the corresponding resource access request based on a reflection mechanism;

[0038] A second processing module, configured to determine a target resource to be accessed according to the resource access request, and obtain a resource access result based on the target resource;

[0039] A third processing module, used to serialize the resource access result and the request identifier to obtain a serialized access result;

[0040] The first sending module is used to send the serialized access result to the first business service process through the connection channel between the first business service process and the corresponding process.

[0041] In some optional embodiments of the present disclosure, the apparatus of the present disclosure further includes:

[0042] The monitoring module is used to monitor the connection status of at least one business service process, and the first business service process is any one of the at least one business service process.

[0043] The network connection establishing module is used to establish a network connection with any one of the at least one business service process after receiving a network connection request from the business service process.

[0044] In some optional embodiments of the present disclosure, the second processing module is specifically used for:

[0045] The target resource to be accessed is determined according to the resource access request, and the minimum resource to be locked is determined according to the target resource; after the minimum resource is locked, the resource access result is obtained based on the target resource.

[0046] In some optional embodiments of the present disclosure, the binary data and the serialized access results are the results obtained by serialization based on the Protobuf protocol; and the reflection mechanism is the reflection mechanism of the Protobuf protocol.

[0047] According to a fourth aspect of the embodiments of the present disclosure, a device for accessing tester resources is provided, comprising:

[0048] An acquisition module, used for acquiring an initial access request from a target application;

[0049] A generating module, used to generate a service access request and a request identifier according to the initial access request;

[0050] A serialization module, used to serialize the service access request and the request identifier to obtain serialized binary data;

[0051] A second sending module, used for sending the binary data to a resource service process, so that the resource service process obtains a serialized access result generated after processing based on the binary data;

[0052] A second receiving module is used to receive the serialized access result sent by the resource service process, and convert the serialized access result into a business access result based on a reflection mechanism;

[0053] The access result returning module is used to return the service access result to the target application.

[0054] In some optional embodiments of the present disclosure, the apparatus of the present disclosure further includes:

[0055] The third sending module is used to send a network connection request to the resource service process, so as to establish a network connection with the resource service process.

[0056] In some optional embodiments of the present disclosure, the second sending module is specifically used for:

[0057] The binary data is sent to the resource service process through the currently idle first sending thread.

[0058] The device of the present disclosure also includes:

[0059] The control module is used to control the first sending thread to enter a dormant state after the first sending thread finishes sending the binary data.

[0060] In some optional embodiments of the present disclosure, the access result returning module is specifically used to:

[0061] The corresponding access request thread is determined according to the request identifier, the waiting access request thread is awakened, and the service access result is returned to the target application through the access request thread.

[0062] In some optional embodiments of the present disclosure, the serialization module is specifically used to: serialize the business access request and the request identifier based on the serialization rules of the Protobuf protocol to obtain serialized binary data.

[0063] In some optional embodiments of the present disclosure, the second receiving module is specifically used to: convert the serialized access result into a business access result based on the reflection mechanism of the Protobuf protocol.

[0064] A fifth aspect of the embodiments of the present disclosure provides a system for accessing tester resources, including:

[0065] The third aspect of the above-mentioned embodiment of the present disclosure provides a device for accessing test machine resources and at least one device for accessing test machine resources provided by the fourth aspect of the above-mentioned embodiment of the present disclosure.

[0066] According to a sixth aspect of an embodiment of the present disclosure, a testing machine is provided, the testing machine comprising:

[0067] A memory for storing a computer program product;

[0068] The processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the method for accessing the test machine resources described in any of the above embodiments of the present disclosure is implemented.

[0069] The access method, device, system and test machine for test machine resources provided by the present invention can establish network connections with multiple business service processes in parallel through independent resource service processes, so that each business service process can access the resource service process in parallel, and then realize parallel access to the test machine resources through the resource service process, and combine serialization and reflection mechanisms to realize data transmission, thereby greatly improving the access performance of the test machine resources, and solving the problem that the needs of users of related technical test machines for high-frequency calling of the test machine interface cannot be met. In addition, the resource service process is an independent process and is not affected by the business service process. When any business service process crashes, it will not affect the resource service process from providing resource access services to other business service processes, thereby improving the stability of the test system of the test machine.

[0070] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0072] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0073] Figure 1 It is a flowchart of a method for accessing test machine resources provided by an exemplary embodiment of the present disclosure;

[0074] Figure 2 is a flowchart of a method for accessing test machine resources provided by another exemplary embodiment of the present disclosure;

[0075] Figure 3 is a flowchart of a method for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure;

[0076] Figure 4 is a flowchart of a method for accessing test machine resources provided by another exemplary embodiment of the present disclosure;

[0077] Figure 5 is a flowchart of a method for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure;

[0078] Figure 6 is a flowchart of a method for accessing test machine resources provided by another exemplary embodiment of the present disclosure;

[0079] Figure 7 is a flowchart of a method for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure;

[0080] Figure 8It is a structural diagram of a device for accessing test machine resources provided by an exemplary embodiment of the present disclosure;

[0081] Fig. 9 is a structural diagram of a device for accessing test machine resources provided by another exemplary embodiment of the present disclosure;

[0082] Fig.10 is a structural diagram of a device for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure;

[0083] Fig.11 is a structural diagram of a device for accessing test machine resources provided by another exemplary embodiment of the present disclosure;

[0084] Fig.12 It is a structural diagram of a system for accessing test machine resources provided by an exemplary embodiment of the present disclosure;

[0085] Fig.13 is a structural schematic diagram of a testing machine provided by an exemplary embodiment of the present disclosure;

[0086] Fig.14 It is a structural schematic diagram of a testing machine provided by another exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0087] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0088] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0089] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0090] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0091] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0092] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0093] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0094] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0095] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0096] Through research, it is found that in the field of testing technology, the limited hardware resources of the testing machine often need to provide services to multiple different users at the same time. In the related technology, the application of the distributed service of the testing machine is usually realized through the RPC distributed network framework. However, the RPC framework of the related technology has the problem of low access performance and cannot meet the requirements for efficient access to the resource service interface of the testing machine. In order to improve the resource access performance of the testing machine, the embodiments of the present disclosure provide a method, device, system and testing machine for accessing the resources of the testing machine. Through an independent resource service process, a network connection can be established with multiple business service processes in parallel, so that each business service process can access the resource service process in parallel, and then realize parallel access to the resources of the testing machine through the resource service process, and realize data transmission by combining serialization and reflection mechanisms, which greatly improves the access performance of the resources of the testing machine.

[0097] Figure 1 The flowchart of the method for accessing test machine resources provided by an exemplary embodiment of the present disclosure is as follows. The method can be applied to the resource service process to improve the resource access performance of the test machine. The method can include the following steps:

[0098] Step 210: Receive binary data sent by the first business service process, where the binary data includes a business access request of the first business service process and a serialization result corresponding to the request identifier.

[0099] Among them, the resource service process can be connected to at least one business service process to provide resource access services for each business service process. The first business service process can be any business service process in at least one business service process. The business access request is an access request in a data format supported by the first business service process. The request identifier is used to distinguish the thread corresponding to the business access request in the first business service process. That is, a business service process can have one or more threads, and multiple threads are distinguished by request identifiers to ensure that each business access request can accurately obtain the corresponding business access result. Serialization can use any implementable serialization protocol, such as Protobuf (ProtocolBuffers), ProtoStuff, hession and other protocols. Among them, the Protobuf protocol consists of a series of messages (message), which is a data description language that can be used for data storage, communication protocols, etc., and does not depend on a specific language and platform. The ProtoStuff protocol is a serialization protocol based on Protobuf, which provides more functions and simpler usage. Hession is a lightweight cross-language serialization protocol. The specific serialization protocol can be set according to actual needs, and this embodiment is not limited.

[0100] In some optional embodiments, the first business service process may be a test machine system process for running test machine system-related programs; the first business service process may also be a test program host process for running user test programs; the first business service process may also be other processes that need to access test machine resources, which may be set specifically according to actual needs.

[0101] In some optional embodiments, the number of first business service processes may be one or more. When the number of first business service processes is multiple, the resource service process may receive binary data sent by multiple first business service processes in parallel, and perform subsequent processing based on the binary data to provide resource access services for each first business service process in parallel.

[0102] In some optional embodiments, the resource service process may receive binary data corresponding to each business service process through a connection channel corresponding to each business service process.

[0103] Step 220: Based on the reflection mechanism, convert the binary data into a corresponding resource access request.

[0104] The reflection mechanism corresponds to the above-mentioned serialization, and is used to convert the serialized binary data into a resource access request in a data format supported by resource access. The resource access request may include relevant information of the resource to be accessed, such as the initialization data of the requested object. Specifically, for example, the binary data is converted into a function name and function parameters for accessing the resource, and the corresponding test machine resource can be accessed by calling back the function corresponding to the function name. The reflection mechanism can adopt the reflection mechanism of the protocol consistent with the above-mentioned serialization protocol, such as the reflection mechanism of the Protobuf protocol.

[0105] Step 230: determine the target resource to be accessed according to the resource access request, and obtain a resource access result based on the target resource.

[0106] Among them, the target resource to be accessed may include at least one of the hardware resources and software resources of the test machine. Since the resource access request includes the relevant information of the resource to be accessed, the target resource to be accessed can be determined according to the resource access request, such as the target resource is a driver resource, a processor resource, etc. in the test machine. The resource access result may include at least one of the test result of the device under test DUT and the status of the hardware resources of the test machine. The status of the hardware resources of the test machine may include, for example, the operating status of the FPGA (Field Programmable Gate Array) on each resource board. The specific resource access result can be set according to actual needs.

[0107] Step 240: serialize the resource access result and the request identifier to obtain a serialized access result.

[0108] The request identifier may be obtained in the process of converting binary data into a resource access request. The binary data may be converted into a resource access request and a corresponding request identifier according to specific serialization and reflection mechanism protocol rules.

[0109] In some optional embodiments, serializing the resource access result and the request identifier may include: serializing the resource access result, obtaining a serialized result, packaging the serialized result and the request identifier, and using the packaged result as the serialized access result.

[0110] Step 250: Send the serialized access result to the first business service process through the connection channel between the first business service process and the corresponding process.

[0111] Each business service process has a corresponding connection channel to connect with the resource service process. The specific connection channel implementation method can be set according to actual needs. For example, when the resource service process and the business service process are on the same host, the communication between the resource service process and the business service process can be realized by using pipes, message queues, semaphores, shared memory, sockets, etc. When the resource service process and the business service process are on different hosts, sockets can be used to realize the communication between the processes.

[0112] The method for accessing test machine resources provided by the embodiment of the present disclosure can establish network connections with multiple business service processes in parallel through an independent resource service process, so that each business service process can access the resource service process in parallel, and then realize parallel access to the test machine resources through the resource service process, and combine serialization and reflection mechanisms to realize data transmission, thereby greatly improving the access performance of the test machine resources, and solving the problem that the demand of users of related technologies for high-frequency calling of the test machine interface cannot be met. In addition, the resource service process is an independent process and is not affected by the business service process. When any business service process crashes, it will not affect the resource service process from providing resource access services to other business service processes, thereby improving the stability of the test system of the test machine.

[0113] Figure 2 It is a flowchart of a method for accessing test machine resources provided by another exemplary embodiment of the present disclosure.

[0114] In some optional embodiments, the method of the present disclosure further includes:

[0115] Step 310: monitor the connection status of at least one business service process, where the first business service process is any one of the at least one business service process.

[0116] Among them, the monitoring of the connection status of the business service process can be achieved through a socket or other monitoring methods, which can be set according to actual needs.

[0117] Step 320: after receiving a network connection request from any one of the at least one business service process, establish a network connection with the business service process.

[0118] Among them, each business service process can serve as the above-mentioned first business service process, and after establishing a network connection with the resource service process, access the test machine resources through the resource service process.

[0119] Exemplarily, the resource service process creates and names a server socket as a server, and the business service process creates a client socket as a client. The resource service process monitors the client socket of the business service process through the server socket. The business service process can call the named socket of the resource service process as an address to trigger a network connection request. The resource service process accepts the connection of the business service process and creates a new socket used only for communication with the business service process as a connection channel between the business service process and the resource service process, thereby establishing a network connection between the resource service process and the business service process. Once the network connection is established, two-way data communication can be achieved through the socket.

[0120] In this embodiment, the resource service process can monitor the status of multiple business service processes, so as to establish a network connection with the multiple business service processes, so as to provide the test machine resource access service for the multiple business service processes in parallel.

[0121] Figure 3 It is a flowchart of a method for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure.

[0122] In some optional embodiments, determining the target resource to be accessed according to the resource access request and obtaining the resource access result based on the target resource in step 230 includes:

[0123] Step 2310, determining the target resource to be accessed according to the resource access request, and determining the minimum resource to be locked according to the target resource.

[0124] The minimum resource to be locked may include at least one of a minimum hardware resource and a minimum software resource.

[0125] In some optional embodiments, the minimum resources can be determined based on the shared resources in the target resources, avoiding resource competition and conflict caused by multiple resource access requests simultaneously accessing the same resource, which may cause the test machine system to crash or produce erroneous results, further improving the stability and reliability of the test machine system.

[0126] In some optional embodiments, the resource service process may have multiple threads, and resource access for multiple resource access requests may be performed through different threads respectively.

[0127] Step 2320, after locking the minimum resource, obtain the resource access result based on the target resource.

[0128] Among them, locking the minimum resource can ensure that the minimum resource can only be accessed by the current resource access request. When other resource access requests need to access the minimum resource, they need to wait, thereby preventing data competition between different access requests.

[0129] This embodiment minimizes locked resources, so that resources that do not need to be locked can be accessed by other access requests, thereby improving resource utilization while ensuring mutually exclusive access.

[0130] In some optional embodiments, the binary data and serialized access results are results obtained by serialization based on the Protobuf protocol; and the reflection mechanism is the reflection mechanism of the Protobuf protocol.

[0131] This embodiment implements serialization and reflection of transmission data through the efficient Protobuf protocol, which can further improve the resource access performance of the test machine.

[0132] In some optional embodiments, the resource service process and the business service process are connected via a socket, combined with the efficient Protobuf protocol, which can further improve the resource access performance of the test machine.

[0133] The method for accessing test machine resources provided by the embodiment of the present disclosure has strong scalability because the resource service process is an independent process. For example, under the condition that the test machine system resources allow, it is possible to allow new business service processes to be expanded according to demand to access the test machine software and hardware resources, and the resource service process does not need to be modified additionally. It only needs to expose the service interface of the resource service process to the newly added business service process, and the corresponding interface configuration is performed in the newly added business service process. It is also possible to expand the service functions corresponding to the new resources to the resource service process when new resources are added to the test machine system, expose the interface of the new service function to each business service process, and update the interface in the business service process to achieve concurrent or parallel access to the new resources by each business service process.

[0134] The above optional embodiments of the present disclosure may be implemented separately or in any combination without conflict, and may be specifically configured according to actual needs.

[0135] Figure 4 This is a flow chart of a method for accessing test machine resources provided by another exemplary embodiment of the present disclosure. The method can be applied to a business service process to improve the resource access performance of the test machine. The method can include the following steps:

[0136] Step 410: Obtain an initial access request from a target application.

[0137] The initial access request is an access request of a user program or a host computer application, that is, the target application can be any one of the user program and the host computer application. The user program is, for example, a user test program. The data format of the initial access request can be set according to actual needs.

[0138] Step 420: Generate a service access request and a request identifier according to the initial access request.

[0139] Among them, the business access request is an access request of the business service process, and the data format of the business access request can be set according to the specific situation of the application program run by the business service process. For example, if the business service process is a process running a user test program, the business access request is a data format supported by the user test program. The request identifier can be generated according to the preset identifier generation rule, as long as it can achieve the purpose of uniquely identifying each thread in the process, and the specific preset identifier generation rule is not limited.

[0140] Step 430: serialize the service access request and the request identifier to obtain serialized binary data.

[0141] The serialization may refer to the aforementioned embodiment and will not be described in detail here.

[0142] In some optional embodiments, the request identifier may be a binary ID, and serializing the business access request and the request identifier may include: serializing the business access request, obtaining a serialization result, packaging the serialization result with the request identifier, and using the packaged result as serialized binary data.

[0143] Step 440: Send the binary data to the resource service process, so that the resource service process obtains a serialized access result based on the binary data.

[0144] Among them, the business service process can send binary data to the resource service process through the corresponding connection channel. The specific processing flow of the resource service process obtaining the serialized access result based on the binary data can be referred to the corresponding embodiment of the resource service process mentioned above, which will not be repeated here. After the resource service process obtains the serialized access result, it sends the serialized access result to the business service process.

[0145] Step 450: Receive the serialized access result sent by the resource service process, and convert the serialized access result into a business access result based on the reflection mechanism.

[0146] Among them, the reflection mechanism is to convert the serialized access results sent by the resource service process into business access results in the data format supported by the target application. The specific reflection mechanism can be set according to actual needs. For example, the reflection mechanism of the above-mentioned Protobuf, ProtoStuff, hession and other protocols can be used.

[0147] In some optional embodiments, the business service process serializes business access requests and reflects the serialized access results, and the resource service process reflects binary data and serializes resource access results, all using the same protocol.

[0148] Step 460: Return the service access result to the target application.

[0149] Among them, the service access result can be returned to the target application that generates the initial access request, so that the target application can perform subsequent operations according to the service access result. For example, the target application is a user test program, and the user test program generates an initial access request for inputting a preset voltage to the device under test. The business service process generates a business access request and a request identifier for driving the preset voltage according to the initial access request, and serializes the business access request and the request identifier to obtain serialized binary data and sends it to the resource service process. The resource service process converts the binary data into a resource access request for accessing the test machine drive resource, controls the drive resource board of the test machine to drive the preset voltage to the device under test, and can control the measurement resource board of the test machine to measure the current result of the device under test at the preset voltage as the resource access result. The resource service process serializes the resource access result and the request identifier to obtain a serialized access result, and sends the serialized access result to the business service process through the corresponding connection channel. The business service process reflects the serialized access result as a business access result in a data format supported by the user test program. After the user test program obtains the business access result, it reports the business access result to the host computer or executes the next test item.

[0150] The method for accessing test machine resources provided by the embodiment of the present disclosure can establish network connections with multiple business service processes in parallel through an independent resource service process, so that the business service process can access the resource service process in parallel, and then access the test machine resources through the resource service process, and combine serialization and reflection mechanisms to realize data transmission, thereby greatly improving the access performance of the test machine resources, and solving the problem that the demand of the related technical test machine users for high-frequency calling of the test machine interface cannot be met. In addition, the resource service process is an independent process and is not affected by the business service process. When any business service process crashes, it will not affect the resource service process to provide resource access services to other business service processes, thereby improving the stability of the test system of the test machine.

[0151] Figure 5 It is a flowchart of a method for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure.

[0152] In some optional embodiments, the method of the present disclosure further includes:

[0153] Step 510: Send a network connection request to the resource service process to establish a network connection with the resource service process.

[0154] The principle of establishing a network connection between the business service process and the resource service process can be found in the above-mentioned embodiment, which will not be described in detail here.

[0155] Figure 6 It is a flowchart of a method for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure.

[0156] In some optional embodiments, sending the binary data to the resource service process in step 440 includes:

[0157] Step 4410: Send the binary data to the resource service process through the currently idle first sending thread.

[0158] Among them, the business service process can have multiple threads. When data needs to be sent to the resource service process, the first idle sending thread can be determined from the multiple threads to send the binary data to the resource service process. Multiple binary data can be sent to the resource service process through multiple sending threads respectively, thereby realizing multi-threaded parallel processing and further improving the access performance of the test machine.

[0159] The method of the present disclosure also includes:

[0160] Step 520: After the first sending thread finishes sending the binary data, control the first sending thread to enter a dormant state.

[0161] Among them, controlling the first sending thread to enter the sleep state can be achieved by calling the corresponding sleep function and the corresponding function parameters. When the first sending thread completes the current binary data transmission, it can be controlled to enter the sleep state to release processor resources so that the released processor resources can be used for other processing, thereby improving resource utilization.

[0162] In some optional embodiments, returning the service access result to the target application in step 460 includes:

[0163] Step 4610, determine the corresponding access request thread according to the request identifier, wake up the waiting access request thread, and return the service access result to the target application through the access request thread.

[0164] Among them, when the business service process obtains the initial access request from the target application, it can obtain it through the access request thread, and distinguish the access request thread through the request identifier. After obtaining the initial access request, it sends it to other threads for subsequent processing. The access request thread enters a sleep state and waits for the business access result. When the business service process obtains the business access result, it determines the corresponding access request thread according to the request identifier, wakes up the access request thread, and then returns the business access result to the target application through the access request thread.

[0165] This embodiment can accurately return the service access result to the target application through the access request thread, so that the target application can run subsequent corresponding programs after obtaining the service access result to complete the operation of the target application.

[0166] Figure 7 It is a flowchart of a method for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure.

[0167] In some optional embodiments, step 430 of serializing the service access request and the request identifier to obtain serialized binary data includes:

[0168] Step 4310: serialize the business access request and the request identifier based on the serialization rules of the Protobuf protocol to obtain serialized binary data.

[0169] Step 450 of receiving the serialized access result sent by the resource service process and converting the serialized access result into a business access result based on the reflection mechanism includes:

[0170] Step 4510, receiving the serialized access result sent by the resource service process.

[0171] Step 4520: Convert the serialized access result into a business access result based on the reflection mechanism of the Protobuf protocol.

[0172] Among them, the serialization and reflection mechanism of the Protobuf protocol can be found in the above content and will not be repeated here.

[0173] This embodiment uses the efficient Protobuf protocol in combination with the inter-process data transmission protocol to implement data transmission between the resource service process and the business service process, which can further improve the access performance of the test machine.

[0174] The above optional embodiments of the present disclosure may be implemented separately or in any combination without conflict, and may be specifically configured according to actual needs.

[0175] Any method for accessing test machine resources provided in the embodiments of the present disclosure can be executed by any appropriate device with data processing capabilities, including but not limited to: terminal devices and servers, etc. Alternatively, any method for accessing test machine resources provided in the embodiments of the present disclosure can be executed by a processor, such as the processor executing any method for accessing test machine resources mentioned in the embodiments of the present disclosure by calling corresponding instructions stored in a memory. This will not be described in detail below.

[0176] Figure 8 1 is a schematic diagram of a structure of a test machine resource access device provided by an exemplary embodiment of the present disclosure. The device of this embodiment can be used to implement a method embodiment of a resource service process corresponding to the present disclosure, such as Figure 8 The device shown includes: a first receiving module 610 , a first processing module 620 , a second processing module 630 , a third processing module 640 and a first sending module 650 .

[0177] The first receiving module 610 is used to receive binary data sent by the first business service process, where the binary data includes a business access request of the first business service process and a serialization result corresponding to the request identifier.

[0178] The first processing module 620 is used to convert binary data into a corresponding resource access request based on a reflection mechanism.

[0179] The second processing module 630 is used to determine the target resource to be accessed according to the resource access request, and obtain the resource access result based on the target resource.

[0180] The third processing module 640 is used to serialize the resource access result and the request identifier to obtain a serialized access result.

[0181] The first sending module 650 is used to send the serialized access result to the first business service process through the connection channel between the first business service process and the corresponding first business service process.

[0182] Fig. 9 It is a structural diagram of a device for accessing test machine resources provided by another exemplary embodiment of the present disclosure.

[0183] In some optional embodiments, the device of the present disclosure further includes:

[0184] The monitoring module 660 is used to monitor the connection status of at least one business service process, where the first business service process is any one of the at least one business service process.

[0185] The network connection establishing module 670 is used to establish a network connection with any one of the at least one business service process after receiving a network connection request from the business service process.

[0186] In some optional embodiments, the second processing module 630 is specifically used for:

[0187] The target resource to be accessed is determined according to the resource access request, and the minimum resource to be locked is determined according to the target resource; after the minimum resource is locked, the resource access result is obtained based on the target resource.

[0188] In some optional embodiments, the binary data and serialized access results are results obtained by serialization based on the Protobuf protocol; and the reflection mechanism is the reflection mechanism of the Protobuf protocol.

[0189] The beneficial technical effects corresponding to the exemplary embodiment of the present device can be found in the corresponding beneficial technical effects of the above exemplary method section, which will not be repeated here.

[0190] Fig.10 1 is a schematic diagram of a structure of a device for accessing test machine resources provided by another exemplary embodiment of the present disclosure. The device of this embodiment can be used to implement a method embodiment of a business service process corresponding to the present disclosure, such as Fig.10 The device shown includes: an acquisition module 710 , a generation module 720 , a serialization module 730 , a second sending module 740 , a second receiving module 750 and an access result returning module 760 .

[0191] The acquisition module 710 is used to acquire an initial access request from a target application.

[0192] The generating module 720 is used to generate a service access request and a request identifier according to the initial access request.

[0193] The serialization module 730 is used to serialize the service access request and the request identifier to obtain serialized binary data.

[0194] The second sending module 740 is used to send the binary data to the resource service process, so that the resource service process obtains a serialized access result based on the binary data.

[0195] The second receiving module 750 is used to receive the serialized access result sent by the resource service process, and convert the serialized access result into a business access result based on the reflection mechanism.

[0196] The access result returning module 760 is used to return the service access result to the target application.

[0197] Fig.11 It is a structural diagram of a device for accessing test machine resources provided by yet another exemplary embodiment of the present disclosure.

[0198] In some optional embodiments, the device of the present disclosure further includes:

[0199] The third sending module 770 is used to send a network connection request to the resource service process, so as to establish a network connection with the resource service process.

[0200] In some optional embodiments, the second sending module 740 is specifically used for:

[0201] The binary data is sent to the resource service process through the currently idle first sending thread.

[0202] The device of the present disclosure also includes:

[0203] The control module 780 is used to control the first sending thread to enter a dormant state after the first sending thread finishes sending the binary data.

[0204] In some optional embodiments, the access result returning module 760 is specifically used for:

[0205] The corresponding access request thread is determined according to the request identifier, the waiting access request thread is awakened, and the service access result is returned to the target application through the access request thread.

[0206] In some optional embodiments, the serialization module 730 is specifically used to serialize the business access request and the request identifier based on the serialization rules of the Protobuf protocol to obtain serialized binary data.

[0207] In some optional embodiments, the second receiving module 750 is specifically used to convert the serialized access result into a business access result based on the reflection mechanism of the Protobuf protocol.

[0208] The beneficial technical effects corresponding to the exemplary embodiment of the present device can be found in the corresponding beneficial technical effects of the above exemplary method section, which will not be repeated here.

[0209] Fig.12 It is a structural diagram of a test machine resource access system provided by an exemplary embodiment of the present disclosure. The test machine resource access system (referred to as the system) may include a test machine resource access device 60 on the resource service process side provided by any of the above embodiments and a test machine resource access device 70 on the business service process side provided by at least one of the above embodiments.

[0210] Among them, the test machine resource access device 60 is used to implement the test machine resource access method on the resource service process side provided by any of the above embodiments, and the test machine resource access device 70 is used to implement the test machine resource access method on the business service process side provided by any of the above embodiments. For details, please refer to the above embodiments and will not be repeated here.

[0211] Fig.13 It is a structural diagram of a test machine provided by an exemplary embodiment of the present disclosure, and the test machine includes a resource service process and at least one business service process. Among them, the resource service process is used to implement the access method of the test machine resources on the resource service process side provided by any of the above embodiments, and each business service process is used to implement the access method of the test machine resources on the business service process side provided by any of the above embodiments. For details, please refer to the above embodiments, which will not be repeated here.

[0212] In addition, the present disclosure also provides a testing machine, including:

[0213] a memory for storing a computer program product;

[0214] The processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the test method of the device under test described in any of the above embodiments of the present disclosure is implemented.

[0215] Fig.14 FIG. 1 is a schematic diagram of the structure of a testing machine provided by another exemplary embodiment of the present disclosure. Fig.14 As shown, the test machine includes one or more processors and memory.

[0216] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the test machine to perform desired functions.

[0217] The memory may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program products may be stored on the computer-readable storage medium, and the processor may run the computer program product to implement the methods of the various embodiments of the present disclosure described above and / or other desired functions.

[0218] In one example, the test machine may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0219] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.

[0220] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0221] Of course, to simplify, Fig.14 Only some of the components in the test machine related to the present disclosure are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the test machine may further include any other appropriate components according to specific application conditions.

[0222] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the method according to various embodiments of the present disclosure described in the above part of this specification.

[0223] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0224] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the method according to various embodiments of the present disclosure described in the above part of this specification.

[0225] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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.

[0226] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0227] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0228] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0229] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0230] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0231] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0232] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0233] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A method for accessing test machine resources, applied to a resource service process, characterized in that: include: Receiving binary data sent by the first business service process, the binary data including a business access request of the first business service process and a serialization result corresponding to the request identifier; Based on the reflection mechanism, convert the binary data into a corresponding resource access request; Determine a target resource to be accessed according to the resource access request, and obtain a resource access result based on the target resource; Serializing the resource access result and the request identifier to obtain a serialized access result; The serialized access result is sent to the first business service process through a connection channel between the first business service process and the corresponding process.

2. The method according to claim 1, characterized in that: Also includes: Monitoring a connection status of at least one business service process, where the first business service process is any one of the at least one business service process; After receiving a network connection request from any one of the at least one business service process, a network connection is established with the business service process.

3. The method according to claim 1, characterized in that Determining a target resource to be accessed according to the resource access request, and obtaining a resource access result based on the target resource, including: Determine a target resource to be accessed according to the resource access request, and determine a minimum resource to be locked according to the target resource; After locking the minimum resource, the resource access result is obtained based on the target resource.

4. The method according to any one of claims 1 to 3, characterized in that: The binary data and the serialized access results are the results obtained by serialization based on the Protobuf protocol; the reflection mechanism is the reflection mechanism of the Protobuf protocol.

5. A method for accessing test machine resources, applied to a business service process, characterized in that: include: Get the initial access request from the target application; Generate a service access request and a request identifier according to the initial access request; Serializing the service access request and the request identifier to obtain serialized binary data; Sending the binary data to a resource service process, so that the resource service process obtains a serialized access result based on the binary data; Receiving the serialized access result sent by the resource service process, and converting the serialized access result into a business access result based on a reflection mechanism; The service access result is returned to the target application.

6. The method according to claim 5, characterized in that Also includes: A network connection request is sent to the resource service process to establish a network connection with the resource service process.

7. The method according to claim 5, characterized in that Sending the binary data to the resource service process includes: Sending the binary data to the resource service process through a currently idle first sending thread; The method further comprises: After the first sending thread finishes sending the binary data, the first sending thread is controlled to enter a dormant state.

8. The method according to claim 5, characterized in that Returning the service access result to the target application includes: The corresponding access request thread is determined according to the request identifier, the waiting access request thread is awakened, and the service access result is returned to the target application through the access request thread.

9. The method according to any one of claims 5 to 8, characterized in that: Serializing the service access request and the request identifier to obtain serialized binary data includes: Serializing the service access request and the request identifier based on the serialization rule of the Protobuf protocol to obtain the serialized binary data; The converting the serialized access result into a service access result based on a reflection mechanism includes: The serialized access result is converted into a business access result based on the reflection mechanism of the Protobuf protocol.

10. A device for accessing test machine resources, characterized in that: include: A first receiving module, configured to receive binary data sent by a first business service process, wherein the binary data includes a business access request of the first business service process and a serialization result corresponding to a request identifier; A first processing module, configured to convert the binary data into the corresponding resource access request based on a reflection mechanism; A second processing module, configured to determine a target resource to be accessed according to the resource access request, and obtain a resource access result based on the target resource; A third processing module, used to serialize the resource access result and the request identifier to obtain a serialized access result; The first sending module is used to send the serialized access result to the first business service process through the connection channel between the first business service process and the corresponding process.

11. A device for accessing test machine resources, characterized in that: include: An acquisition module, used for acquiring an initial access request from a target application; A generating module, used to generate a service access request and a request identifier according to the initial access request; A serialization module, used to serialize the service access request and the request identifier to obtain serialized binary data; A second sending module, used for sending the binary data to a resource service process, so that the resource service process obtains a serialized access result based on the binary data; A second receiving module is used to receive the serialized access result sent by the resource service process, and convert the serialized access result into a business access result based on a reflection mechanism; The access result returning module is used to return the service access result to the target application.

12. A system for accessing test machine resources, characterized in that: include: The access device for testing machine resources as claimed in claim 10 and at least one access device for testing machine resources as claimed in claim 11.

13. A testing machine, characterized in that: include: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the method for accessing the test machine resources described in any one of claims 1 to 9 is implemented.